-
Notifications
You must be signed in to change notification settings - Fork 6.3k
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
[wintoast] Add new port. #7006
Conversation
ports/wintoast/portfile.cmake
Outdated
) | ||
|
||
# Install source files | ||
file(INSTALL ${SOURCE_PATH}/src/wintoastlib.cpp |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
Thanks for the PR! |
ports/wintoast/CMakeLists.txt
Outdated
src/wintoastlib.cpp | ||
) | ||
|
||
add_library(wintoast ${SRC_FILES} ${HEADER_FILES}) |
There was a problem hiding this comment.
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()
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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?
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Thanks for the PR! |
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.