diff --git a/CMakeLists.txt b/CMakeLists.txt index 08832edf..d274a5bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -37,9 +37,11 @@ endif() if(Qt6_FOUND) set(QT_VERSION_MAJOR 6) + set(QT_VERSION ${Qt6_VERSION}) else() find_package(Qt5 REQUIRED COMPONENTS Core DBus Gui Quick) set(QT_VERSION_MAJOR 5) + set(QT_VERSION ${Qt5_VERSION}) endif() set(MALIIT_EXE_SUFFIX "") @@ -399,10 +401,10 @@ configure_file(src/maliit-defines.prf.in maliit-defines.prf @ONLY) include(CMakePackageConfigHelpers) -configure_package_config_file(src/MaliitPluginsConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/MaliitPluginsConfig.cmake - INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/MaliitPlugins +configure_package_config_file(src/MaliitPluginsConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/Maliit${MALIIT_LIB_SUFFIX}PluginsConfig.cmake + INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/Maliit${MALIIT_LIB_SUFFIX}Plugins PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_DATADIR) -write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/MaliitPluginsConfigVersion.cmake +write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/Maliit${MALIIT_LIB_SUFFIX}PluginsConfigVersion.cmake VERSION ${PACKAGE_VERSION} COMPATIBILITY AnyNewerVersion) @@ -440,18 +442,18 @@ install(FILES install(FILES ${CMAKE_BINARY_DIR}/maliit-framework.prf ${CMAKE_BINARY_DIR}/maliit-plugins.prf ${CMAKE_BINARY_DIR}/maliit-defines.prf DESTINATION ${QT_MKSPECS_INSTALL_DIR}/features) -install(EXPORT MaliitPluginsTargets FILE MaliitPluginsTargets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MaliitPlugins) -install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MaliitPluginsConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/MaliitPluginsConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MaliitPlugins) +install(EXPORT MaliitPluginsTargets FILE Maliit${MALIIT_LIB_SUFFIX}PluginsTargets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Maliit${MALIIT_LIB_SUFFIX}Plugins) +install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Maliit${MALIIT_LIB_SUFFIX}PluginsConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/Maliit${MALIIT_LIB_SUFFIX}PluginsConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Maliit${MALIIT_LIB_SUFFIX}Plugins) install(FILES INSTALL.local LICENSE.LGPL NEWS README.md DESTINATION ${CMAKE_INSTALL_DATADIR}/doc/maliit-framework) if(enable-glib) - configure_package_config_file(maliit-glib/MaliitGLibConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/MaliitGLibConfig.cmake - INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/MaliitGLib + configure_package_config_file(maliit-glib/MaliitGLibConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/Maliit${MALIIT_LIB_SUFFIX}GLibConfig.cmake + INSTALL_DESTINATION ${LIB_INSTALL_DIR}/cmake/Maliit${MALIIT_LIB_SUFFIX}GLib PATH_VARS CMAKE_INSTALL_INCLUDEDIR CMAKE_INSTALL_LIBDIR CMAKE_INSTALL_DATADIR) - write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/MaliitGLibConfigVersion.cmake + write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/Maliit${MALIIT_LIB_SUFFIX}GLibConfigVersion.cmake VERSION ${PACKAGE_VERSION} COMPATIBILITY AnyNewerVersion) @@ -467,9 +469,9 @@ if(enable-glib) install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/maliit${MALIIT_LIB_SUFFIX}-glib DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/maliit-2 FILES_MATCHING PATTERN "*.h") - install(EXPORT MaliitGLibTargets FILE MaliitGLibTargets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MaliitGLib) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/MaliitGLibConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/MaliitGLibConfigVersion.cmake - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/MaliitGLib) + install(EXPORT MaliitGLibTargets FILE Maliit${MALIIT_LIB_SUFFIX}GLibTargets.cmake DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Maliit${MALIIT_LIB_SUFFIX}GLib) + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Maliit${MALIIT_LIB_SUFFIX}GLibConfig.cmake ${CMAKE_CURRENT_BINARY_DIR}/Maliit${MALIIT_LIB_SUFFIX}GLibConfigVersion.cmake + DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/Maliit${MALIIT_LIB_SUFFIX}GLib) install(FILES ${CMAKE_BINARY_DIR}/maliit${MALIIT_LIB_SUFFIX}-glib.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig) endif() diff --git a/maliit-glib/MaliitGLibConfig.cmake.in b/maliit-glib/MaliitGLibConfig.cmake.in index fcb99e25..5a46d019 100644 --- a/maliit-glib/MaliitGLibConfig.cmake.in +++ b/maliit-glib/MaliitGLibConfig.cmake.in @@ -1 +1 @@ -include("${CMAKE_CURRENT_LIST_DIR}/MaliitGLibTargets.cmake") \ No newline at end of file +include("${CMAKE_CURRENT_LIST_DIR}/Maliit@MALIIT_LIB_SUFFIX@GLibTargets.cmake") diff --git a/src/MaliitPluginsConfig.cmake.in b/src/MaliitPluginsConfig.cmake.in index e9178da4..57b0832e 100644 --- a/src/MaliitPluginsConfig.cmake.in +++ b/src/MaliitPluginsConfig.cmake.in @@ -1,7 +1,7 @@ include(CMakeFindDependencyMacro) -find_dependency(Qt5Core @Qt5Core_VERSION@) -find_dependency(Qt5Gui @Qt5Gui_VERSION@) -find_dependency(Qt5Quick @Qt5Quick_VERSION@) +find_dependency(Qt@QT_VERSION_MAJOR@Core @QT_VERSION@) +find_dependency(Qt@QT_VERSION_MAJOR@Gui @QT_VERSION@) +find_dependency(Qt@QT_VERSION_MAJOR@Quick @QT_VERSION@) -include("${CMAKE_CURRENT_LIST_DIR}/MaliitPluginsTargets.cmake") \ No newline at end of file +include("${CMAKE_CURRENT_LIST_DIR}/Maliit@MALIIT_LIB_SUFFIX@PluginsTargets.cmake")