diff options
author | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-08 22:29:54 +0100 |
---|---|---|
committer | Tobias Hunger <tobias.hunger@qt.io> | 2018-11-22 15:20:42 +0000 |
commit | 74e927855385d46d53ce13460d4d72ad605b1dae (patch) | |
tree | d3b24884ce55c5c1653e02098a17b73d793465aa | |
parent | 24fe9211617ad1f98c69c2702e2b10412c7a55d7 (diff) |
CMake: Simplify registration of known Qt targets
Change-Id: Ibd7b5f628c0a1a3087bdfebb0c35242b42c5e938
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
-rw-r--r-- | cmake/QtBuild.cmake | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake index ee910155dd..0081f064ec 100644 --- a/cmake/QtBuild.cmake +++ b/cmake/QtBuild.cmake @@ -67,9 +67,12 @@ set(QT_PLATFORM_DEFINITION_DIR ${QT_DEFAULT_PLATFORM_DEFINITION_DIR} CACHE PATH "Path to directory that contains qplatformdefs.h") set(QT_NAMESPACE "" CACHE STRING "Qt Namespace") -# Reset: -set(KNOWN_QT_MODULES "" CACHE INTERNAL "Known Qt modules" FORCE) +macro(_set_known_qt_modules) + set(KNOWN_QT_MODULES ${ARGN} CACHE INTERNAL "Known Qt modules" FORCE) +endmacro() +# Reset: +_set_known_qt_modules("") # For adjusting variables when running tests, we need to know what # the correct variable is for separating entries in PATH-alike @@ -531,8 +534,7 @@ function(add_qt_module name) string(TOUPPER "${name}" name_upper) string(TOLOWER "${name}" name_lower) - set(known_modules "${KNOWN_QT_MODULES}" "${target}") - set(KNOWN_QT_MODULES ${known_modules} CACHE INTERNAL "Modules that are built." FORCE) + _set_known_qt_modules("${KNOWN_QT_MODULES}" "${target}") ### Define Targets: if(${_arg_STATIC}) |