Skip to content

Commit

Permalink
CMake: Use CMakePackageConfigHelpers to generate the package config
Browse files Browse the repository at this point in the history
Now we also generate a QXmppConfigVersion.cmake file.
  • Loading branch information
olesalscheider authored and jlaine committed Sep 24, 2018
1 parent 34b6a75 commit f97336f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
17 changes: 16 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,23 @@ if(BUILD_EXAMPLES)
add_subdirectory(examples)
endif()

include(CMakePackageConfigHelpers)

configure_package_config_file(
QXmppConfig.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/QXmppConfig.cmake
INSTALL_DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/qxmpp"
)

write_basic_package_version_file(
${CMAKE_CURRENT_BINARY_DIR}/QXmppConfigVersion.cmake
VERSION ${VERSION_STRING}
COMPATIBILITY SameMajorVersion
)

install(
FILES QXmppConfig.cmake
FILES ${CMAKE_CURRENT_BINARY_DIR}/QXmppConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/QXmppConfigVersion.cmake
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/qxmpp"
COMPONENT Devel
)
Expand Down
3 changes: 0 additions & 3 deletions QXmppConfig.cmake

This file was deleted.

4 changes: 4 additions & 0 deletions QXmppConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@PACKAGE_INIT@
include("${CMAKE_CURRENT_LIST_DIR}/QXmpp.cmake")
check_required_components(QXmpp)

0 comments on commit f97336f

Please sign in to comment.