summaryrefslogtreecommitdiffstats
path: root/cmake/QtBaseGlobalTargets.cmake
diff options
context:
space:
mode:
authorTobias Hunger <tobias.hunger@qt.io>2019-01-10 10:50:38 +0100
committerTobias Hunger <tobias.hunger@qt.io>2019-01-17 08:33:27 +0000
commit4f26758978e84f959a28d90b2ff336bae32a2d3f (patch)
tree056a6c261a0dd79696a36ea5f962a9b8aa8ac27e /cmake/QtBaseGlobalTargets.cmake
parentb705021b4eaed1e61d39dc481fd5373722c6f460 (diff)
CMake: Introduce Qt::GlobalConfig to hold the global features
This simplifies the handling of features a bit as it removes the special code to store two sets of features in Qt::Core. Change-Id: I536d41cfc76a02af054e3cfbad6bda50b1e9e49a Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'cmake/QtBaseGlobalTargets.cmake')
-rw-r--r--cmake/QtBaseGlobalTargets.cmake29
1 files changed, 24 insertions, 5 deletions
diff --git a/cmake/QtBaseGlobalTargets.cmake b/cmake/QtBaseGlobalTargets.cmake
index b53fd0f368..714508ec7c 100644
--- a/cmake/QtBaseGlobalTargets.cmake
+++ b/cmake/QtBaseGlobalTargets.cmake
@@ -15,8 +15,6 @@ target_include_directories("${name}"
)
target_compile_definitions("${name}" INTERFACE ${QT_PLATFORM_DEFINITIONS})
set(config_install_dir "${INSTALL_LIBDIR}/cmake/${name}${PROJECT_VERSION_MAJOR}")
-install(TARGETS "${name}" EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets")
-install(EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets" NAMESPACE Qt:: DESTINATION "${config_install_dir}")
configure_package_config_file(
"${PROJECT_SOURCE_DIR}/cmake/QtConfig.cmake.in"
@@ -37,15 +35,36 @@ install(FILES
## Library to hold global features:
-add_library(Qt_global_Config INTERFACE)
-
+## These features are stored and accessed via Qt::GlobalConfig, but the
+## files always lived in Qt::Core, so we keep it that way
+add_library(GlobalConfig INTERFACE)
+target_include_directories(GlobalConfig INTERFACE
+ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
+ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/QtCore>
+ $<INSTALL_INTERFACE:include>
+ $<INSTALL_INTERFACE:include/QtCore>
+)
qt_feature_module_begin(LIBRARY Core
PUBLIC_FILE src/corelib/global/qconfig.h
PRIVATE_FILE src/corelib/global/qconfig_p.h
)
include("${CMAKE_CURRENT_SOURCE_DIR}/configure.cmake")
-qt_feature_module_end(Qt_global_Config)
+qt_feature_module_end(GlobalConfig)
+add_library(Qt::GlobalConfig ALIAS GlobalConfig)
+
+add_library(GlobalConfigPrivate INTERFACE)
+target_link_libraries(GlobalConfigPrivate INTERFACE GlobalConfig)
+target_include_directories(GlobalConfigPrivate INTERFACE
+ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}>
+ $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include/QtCore/${PROJECT_VERSION}/QtCore>
+ $<INSTALL_INTERFACE:include/QtCore/${PROJECT_VERSION}>
+ $<INSTALL_INTERFACE:include/QtCore/${PROJECT_VERSION}/QtCore>
+)
+add_library(Qt::GlobalConfigPrivate ALIAS GlobalConfigPrivate)
+
+install(TARGETS "${name}" GlobalConfig GlobalConfigPrivate EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets")
+install(EXPORT "${name}${PROJECT_VERSION_MAJOR}Targets" NAMESPACE Qt:: DESTINATION "${config_install_dir}")
## Install some QtBase specific CMake files:
install(FILES