summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-06-19 14:45:35 +0200
committerJoerg Bornemann <joerg.bornemann@qt.io>2020-06-19 18:41:23 +0200
commit7f2ff4ffce8da68669855b16f5e2ecd9954aa33d (patch)
treead616f7b7a167471c3da84070504be1cd662fdf7 /cmake
parent47a4e6a9497b068a0400ba3f01629c62608e1ec3 (diff)
CMake: Do not file(GENERATE) illegal genexes in .pri file generation
We must filter out expressions of the form $<TARGET_PROPERTY:name>, because 1. They cannot be used in file(GENERATE) content. 2. They refer to the consuming target we have no access to here. The CMake error Error evaluating generator expression: $<TARGET_PROPERTY:QT_PLUGIN_CLASS_NAME> was triggered when building the UiPlugin module of qttools. Change-Id: Idf639be50120b94d68a70965604e6f1ef72edc9b Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'cmake')
-rw-r--r--cmake/QtBuild.cmake5
1 files changed, 5 insertions, 0 deletions
diff --git a/cmake/QtBuild.cmake b/cmake/QtBuild.cmake
index d5e00e4c94..ff6e72eff2 100644
--- a/cmake/QtBuild.cmake
+++ b/cmake/QtBuild.cmake
@@ -835,6 +835,11 @@ function(qt_generate_module_pri_file target)
# will compute the transitive list of all defines for a module (so Gui would get Core
#defines too). Instead query just the public defines on the target.
get_target_property(target_defines "${target}" INTERFACE_COMPILE_DEFINITIONS)
+
+ # We must filter out expressions of the form $<TARGET_PROPERTY:name>, because
+ # 1. They cannot be used in file(GENERATE) content.
+ # 2. They refer to the consuming target we have no access to here.
+ list(FILTER target_defines EXCLUDE REGEX "\\$<TARGET_PROPERTY:[^,>]+>")
list(JOIN target_defines " " joined_target_defines)
file(GENERATE