diff --git a/CMakeLists.txt b/CMakeLists.txt index 57f5c8e3..0ee73a07 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -119,6 +119,7 @@ add_definitions("-Werror=implicit-function-declaration" "-Wno-unused-parameter") # enable C++11 set(CMAKE_CXX_STANDARD "11") +include(CMakePackageConfigHelpers) find_package(PkgConfig REQUIRED) add_subdirectory(src) diff --git a/qt/AppStreamQtConfig.cmake.in b/qt/AppStreamQtConfig.cmake.in index 0165f0e0..10604f7c 100644 --- a/qt/AppStreamQtConfig.cmake.in +++ b/qt/AppStreamQtConfig.cmake.in @@ -1,3 +1,5 @@ @PACKAGE_INIT@ +check_required_components(Qt5Core) + include("${CMAKE_CURRENT_LIST_DIR}/AppStreamQtTargets.cmake") diff --git a/qt/CMakeLists.txt b/qt/CMakeLists.txt index 82778018..5c3ef7d9 100644 --- a/qt/CMakeLists.txt +++ b/qt/CMakeLists.txt @@ -80,10 +80,10 @@ install(FILES ${APPSTREAMQT_PUBLIC_HEADERS} ${CMAKE_CURRENT_BINARY_DIR}/appstrea set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/AppStreamQt) -configure_file( +configure_package_config_file( "${CMAKE_CURRENT_SOURCE_DIR}/AppStreamQtConfig.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/AppStreamQtConfig.cmake" - @ONLY + INSTALL_DESTINATION ${ConfigPackageLocation} ) install(EXPORT AppStreamLibsTarget