aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2006-05-17 19:43:11 +0000
committerAlexander Neundorf <neundorf@kde.org>2006-05-17 19:43:11 +0000
commita5089afc9d4e98d5bf2d7b39cf94a8953cbc56af (patch)
treecd6ca8782d29a41bad344d54891f8e1defc21c4d
parentb69c0d30a452aecd3d4a1eb1535f26fdad9619aa (diff)
downloadextra-cmake-modules-a5089afc9d4e98d5bf2d7b39cf94a8953cbc56af.tar.gz
extra-cmake-modules-a5089afc9d4e98d5bf2d7b39cf94a8953cbc56af.tar.bz2
-the behaviour of LIST(REMOVE_ITEM ...) changed from cmake 2.4.1 beta to cmake 2.4.2, add a check
to work with both (2.4.1 was only a beta and so not to be considered stable, and I was even one of the people who wanted this change) This hack can be removed once we require a cmake version >= 2.4.2 Alex svn path=/trunk/KDE/kdelibs/; revision=541957
-rw-r--r--modules/KDE4Macros.cmake20
1 files changed, 19 insertions, 1 deletions
diff --git a/modules/KDE4Macros.cmake b/modules/KDE4Macros.cmake
index 75a8e8db..1fafbcf9 100644
--- a/modules/KDE4Macros.cmake
+++ b/modules/KDE4Macros.cmake
@@ -451,6 +451,24 @@ MACRO (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX)
ENDMACRO (KDE4_ADD_PLUGIN _target_NAME _with_PREFIX)
+# hmm this is a hack
+# the behaviour of LIST(REMOVE_ITEM ... ) changed from 2.4.1 beta to 2.4.2 stable
+# detect this here
+# this can be removed once we require cmake >= 2.4.2
+set(remove_item_test_list one two)
+# with cmake 2.4.1 this means remove index 0,
+# with >= 2.4.2 this means remove the items which have the value "0"
+list(REMOVE_ITEM remove_item_test_list 0)
+list(LENGTH remove_item_test_list _test_list_length)
+# so with 2.4.1 the list will have only one item left, with 2.4.2 two
+if (${_test_list_length} EQUAL 2)
+ set(_REMOVE_AT_INDEX_KEYWORD REMOVE_AT)
+else (${_test_list_length} EQUAL 2)
+ set(_REMOVE_AT_INDEX_KEYWORD REMOVE_ITEM)
+endif (${_test_list_length} EQUAL 2)
+
+
+
# this macro checks is intended to check whether a list of source
# files has the "NOGUI" or "RUN_UNINSTALLED" keywords at the beginning
# in _output_LIST the list of source files is returned with the "NOGUI"
@@ -497,7 +515,7 @@ MACRO(KDE4_CHECK_EXECUTABLE_PARAMS _output_LIST _nogui _uninst)
endif (${second_PARAM} STREQUAL "RUN_UNINSTALLED")
if (NOT "${remove}" STREQUAL "NOTFOUND")
- list(REMOVE_ITEM ${_output_LIST} ${remove})
+ list(${_REMOVE_AT_INDEX_KEYWORD} ${_output_LIST} ${remove})
endif (NOT "${remove}" STREQUAL "NOTFOUND")
ENDMACRO(KDE4_CHECK_EXECUTABLE_PARAMS)