Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wintoast] Add new port. #7006

Merged
merged 3 commits into from
Jul 15, 2019
Merged

Conversation

NancyLi1013
Copy link
Contributor

WinToast is a lightly library written in C++ which brings a complete integration of the modern toast notifications of Windows 8 & Windows 10.
Related issue #6706.

@NancyLi1013 NancyLi1013 marked this pull request as ready for review June 24, 2019 02:56
@PhoebeHui PhoebeHui added the info:internal This PR or Issue was filed by the vcpkg team. label Jun 24, 2019
)

# Install source files
file(INSTALL ${SOURCE_PATH}/src/wintoastlib.cpp
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should generally build cpp source files into a library instead of installing them.

In this case, we should write a CMakeLists.txt that builds a static library and add vcpkg_check_linkage(ONLY_STATIC_LIBRARY) to the top of this portfile.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added CMakeLists.txt file and updated this portfile. Please help check it again. Thanks.

@NancyLi1013
Copy link
Contributor Author

WinToast only supports on Windows platform. So the current results are expected. And it doesn't currently support UWP. I have added the message in portfile.cmake.

@vicroms
Copy link
Member

vicroms commented Jul 1, 2019

Thanks for the PR!

src/wintoastlib.cpp
)

add_library(wintoast ${SRC_FILES} ${HEADER_FILES})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Header files should be added using target_include_directories

target_include_directories(wintoast PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
  $<INSTALL_INTERFACE:include/wintoast>
)

And installed using

# Install headers
if (INSTALL_HEADERS)
  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/src/wintoatstlib.h DESTINATION include/wintoast)
endif()

The INSTALL_HEADERS option allows us to skip installing headers during the debug build by setting the option to OFF during vcpkg_configure_cmake()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review and advice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May I say that I find the practice of including the header of a single header library via #include <HeaderName.h> instead of #include Libname/HeaderName.h really annoying?

@vicroms
Copy link
Member

vicroms commented Jul 15, 2019

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@vicroms
Copy link
Member

vicroms commented Jul 15, 2019

@NancyLi1013

Thanks for the PR!

@vicroms vicroms merged commit 583abdf into microsoft:master Jul 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
info:internal This PR or Issue was filed by the vcpkg team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants