aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorFriedrich W. H. Kossebau <kossebau@kde.org>2021-09-01 06:23:13 +0200
committerFriedrich W. H. Kossebau <kossebau@kde.org>2021-09-01 06:23:13 +0200
commit6561e3a25881368a85492d41aa21ddd9744745af (patch)
treea154ccb8f80c6fca51f33700480bdafc4f008053 /modules
parenta1a531f17fc0484265cefc046950a07fb3b5e04f (diff)
downloadextra-cmake-modules-6561e3a25881368a85492d41aa21ddd9744745af.tar.gz
extra-cmake-modules-6561e3a25881368a85492d41aa21ddd9744745af.tar.bz2
ECMSetupQtPluginMacroNames: avoid use of IN_LIST in generated codev5.86.0-rc1v5.86.0
NO_CHANGELOG
Diffstat (limited to 'modules')
-rw-r--r--modules/ECMSetupQtPluginMacroNames.cmake13
1 files changed, 9 insertions, 4 deletions
diff --git a/modules/ECMSetupQtPluginMacroNames.cmake b/modules/ECMSetupQtPluginMacroNames.cmake
index b1841a36..64fa949f 100644
--- a/modules/ECMSetupQtPluginMacroNames.cmake
+++ b/modules/ECMSetupQtPluginMacroNames.cmake
@@ -147,6 +147,7 @@ macro(ecm_setup_qtplugin_macro_names)
# While there currently is no simple way known to have a unique flag to track
# if the code was already executed, at least by the data currently passed to this macro,
# simply check for the presence of the new entries before adding them for now.
+ # Not using IN_LIST in generated code, as projects might have CMP0057 set to OLD
set(_content
"####################################################################################
# CMAKE_AUTOMOC
@@ -162,7 +163,8 @@ macro(ecm_setup_qtplugin_macro_names)
# 3.10+ lets us provide more macro names that require automoc.
foreach(macro_name ${_all_macro_names})
# we can be run multiple times, so add only once
- if(NOT \${macro_name} IN_LIST CMAKE_AUTOMOC_MACRO_NAMES)
+ list (FIND CMAKE_AUTOMOC_MACRO_NAMES \"\${macro_name}\" _index)
+ if(_index LESS 0)
list(APPEND CMAKE_AUTOMOC_MACRO_NAMES \${macro_name})
endif()
endforeach()
@@ -177,7 +179,8 @@ endforeach()
string(APPEND _content
"foreach(macro_name ${ESQMN_JSON_ARG1})
# we can be run multiple times, so add only once
- if(NOT \${macro_name} IN_LIST CMAKE_AUTOMOC_DEPEND_FILTERS)
+ list (FIND CMAKE_AUTOMOC_DEPEND_FILTERS \"\${macro_name}\" _index)
+ if(_index LESS 0)
list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
\"\${macro_name}\"
\"[\\n^][ \\t]*\${macro_name}[ \\t\\n]*\\\\([ \\t\\n]*\\\"([^\\\"]+)\\\"\"
@@ -190,7 +193,8 @@ endforeach()
string(APPEND _content
"foreach(macro_name ${ESQMN_JSON_ARG2})
# we can be run multiple times, so add only once
- if(NOT \${macro_name} IN_LIST CMAKE_AUTOMOC_DEPEND_FILTERS)
+ list (FIND CMAKE_AUTOMOC_DEPEND_FILTERS \"\${macro_name}\" _index)
+ if(_index LESS 0)
list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
\"\${macro_name}\"
\"[\\n^][ \\t]*\${macro_name}[ \\t\\n]*\\\\([^,]*,[ \\t\\n]*\\\"([^\\\"]+)\\\"\"
@@ -203,7 +207,8 @@ endforeach()
string(APPEND _content
"foreach(macro_name ${ESQMN_JSON_ARG3})
# we can be run multiple times, so add only once
- if(NOT \${macro_name} IN_LIST CMAKE_AUTOMOC_DEPEND_FILTERS)
+ list (FIND CMAKE_AUTOMOC_DEPEND_FILTERS \"\${macro_name}\" _index)
+ if(_index LESS 0)
list(APPEND CMAKE_AUTOMOC_DEPEND_FILTERS
\"\${macro_name}\"
\"[\\n^][ \\t]*\${macro_name}[ \\t\\n]*\\\\([^,]*,[^,]*,[ \\t\\n]*\\\"([^\\\"]+)\\\"\"