summaryrefslogtreecommitdiffstats
path: root/src/corelib/CMakeLists.txt
diff options
context:
space:
mode:
authorLeander Beernaert <leander.beernaert@qt.io>2019-08-19 16:19:08 +0200
committerLeander Beernaert <leander.beernaert@qt.io>2019-08-22 09:47:01 +0000
commit7a1853dbe2a3e316900ed1daf9f05deb37413d72 (patch)
tree882208a1912a5ab80c4c25ec7265fb8502d4305d /src/corelib/CMakeLists.txt
parent3cb9ee3a5b36e2c10dbaf1564852472e7e02a1ae (diff)
Extract add_qt_resource into reusable components
This patch moves all of the underlying code for add_qt_resource into a common reusable snippet for both the Qt build and user projects. For users, the new API is available under QT5_ADD_RESOURCES. If outfiles is a CMAKE target we will use the new API, otherwise we will fall back to the old behavior. This patch also adds EXTRA_CMAKE_FILES and EXTRA_CMAKE_INCLUDES to add_qt_module so that module specific cmake files can be installed and loaded by the module's config.cmake. The code will be installed under CMAKE_BINARY_DIR/Qt{}CoreResource.cmake and is injected into Qt{}Core_Config.cmake via the extra cmake includes passed into add_qt_module. To make sure it still works with QtBuild, we do the actual generation of the file from QtBaseGlobalTargets and include the generated file there as well. Change-Id: I85fefaa11dde01a6790d23c62d6a64cd157e2617 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib/CMakeLists.txt')
-rw-r--r--src/corelib/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt
index 8d676e1be0..2959939458 100644
--- a/src/corelib/CMakeLists.txt
+++ b/src/corelib/CMakeLists.txt
@@ -250,6 +250,11 @@ add_qt_module(Core
PUBLIC_LIBRARIES # special case:
Qt::Platform # special case:
DISABLE_TOOLS_EXPORT # special case:
+ # special case begin
+ # Generated in QtBaseGlobalTargets
+ EXTRA_CMAKE_FILES ${QT_CORE_RESOURCE_GENERATED_FILE_PATH}
+ EXTRA_CMAKE_INCLUDES ${QT_CORE_RESOURCE_GENERATED_FILE_NAME}
+ # special case end
)
# special case begin