-
Notifications
You must be signed in to change notification settings - Fork 97
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
Added options to command find_package #228
Conversation
@vszakats What do you think about this change? |
lib/CMakeLists.txt
Outdated
write_basic_package_version_file( | ||
"${NGHTTP3_VERSION_CONFIG}" VERSION ${NGHTTP3_VERSION} COMPATIBILITY SameMajorVersion | ||
) | ||
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/config.cmake.in" "${NGHTTP3_PROJECT_CONFIG}" @ONLY) | ||
|
||
# Install cmake config files | ||
install( | ||
FILES "${NGHTTP3_PROJECT_CONFIG}" "${NGHTTP3_VERSION_CONFIG}" | ||
DESTINATION "${NGHTTP3_CONFIG_INSTALL_DIR}") | ||
|
||
install( | ||
EXPORT "${NGHTTP3_TARGETS_EXPORT_NAME}" | ||
NAMESPACE "${NGHTTP3_NAMESPACE}" | ||
DESTINATION "${NGHTTP3_CONFIG_INSTALL_DIR}") |
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.
write_basic_package_version_file( | |
"${NGHTTP3_VERSION_CONFIG}" VERSION ${NGHTTP3_VERSION} COMPATIBILITY SameMajorVersion | |
) | |
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/config.cmake.in" "${NGHTTP3_PROJECT_CONFIG}" @ONLY) | |
# Install cmake config files | |
install( | |
FILES "${NGHTTP3_PROJECT_CONFIG}" "${NGHTTP3_VERSION_CONFIG}" | |
DESTINATION "${NGHTTP3_CONFIG_INSTALL_DIR}") | |
install( | |
EXPORT "${NGHTTP3_TARGETS_EXPORT_NAME}" | |
NAMESPACE "${NGHTTP3_NAMESPACE}" | |
DESTINATION "${NGHTTP3_CONFIG_INSTALL_DIR}") | |
write_basic_package_version_file( | |
"${NGHTTP3_VERSION_CONFIG}" VERSION ${NGHTTP3_VERSION} COMPATIBILITY SameMajorVersion | |
) | |
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules/config.cmake.in" "${NGHTTP3_PROJECT_CONFIG}" @ONLY) | |
# Install cmake config files | |
install( | |
FILES "${NGHTTP3_PROJECT_CONFIG}" "${NGHTTP3_VERSION_CONFIG}" | |
DESTINATION "${NGHTTP3_CONFIG_INSTALL_DIR}") | |
install( | |
EXPORT "${NGHTTP3_TARGETS_EXPORT_NAME}" | |
NAMESPACE "${NGHTTP3_NAMESPACE}" | |
DESTINATION "${NGHTTP3_CONFIG_INSTALL_DIR}") |
nits: whitespace/indentation
lib/CMakeLists.txt
Outdated
DESTINATION "${CMAKE_INSTALL_LIBDIR}") | ||
endif() | ||
|
||
install(FILES "${CMAKE_CURRENT_BINARY_DIR}/libnghttp3.pc" | ||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig") | ||
|
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.
nit: delete extra newline at the end of file.
lib/cmake_modules/config.cmake.in
Outdated
@@ -0,0 +1,3 @@ | |||
include(CMakeFindDependencyMacro) | |||
|
|||
include("${CMAKE_CURRENT_LIST_DIR}/@NGHTTP3_TARGETS_EXPORT_NAME@.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.
A newline is missing at he end of this file.
What do you think of moving this file to the existing cmake
directory instead?
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.
It's okay for me
@vszakats Thank you for the quick review! |
I've modified the files, I've moved the pkgconfig to the end of the CMakeLists.txt, where it was located originally, about the modifications suggested by @vszakats, i perceived that the snippets indicated by him was at same identation level of the entry script, meaning without identation. I've moved the config.cmake.in to the same CMakeLists.txt dir. |
Thanks @bmarques1995. Looks good to me, also agreeing on the |
lib/config.cmake.in needs to be added to Line 26 in 6bcfffb
|
Could u test again? And how do i test by myself? |
Thank you for PR. Merged now. |
Now is possible to use the command find_package with cmake to find nghttp3