diff options
author | Alexander Neundorf <neundorf@kde.org> | 2008-01-18 20:52:54 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2008-01-18 20:52:54 (GMT) |
commit | fc8ce174334c3c33141d37ff2b86ea50226b7ce4 (patch) | |
tree | 1f911b47f1b323c1c8250cd6cc89c427c87e0860 /Tests/FunctionTest | |
parent | e5a4da5b3c930bf19710db638f3d1b86ccbfb3aa (diff) | |
download | CMake-fc8ce174334c3c33141d37ff2b86ea50226b7ce4.zip CMake-fc8ce174334c3c33141d37ff2b86ea50226b7ce4.tar.gz CMake-fc8ce174334c3c33141d37ff2b86ea50226b7ce4.tar.bz2 |
ENH: remove RAISE_SCOPE() again and instead add SET(<var> <value> PARENT_SCOPE)
Alex
Diffstat (limited to 'Tests/FunctionTest')
-rw-r--r-- | Tests/FunctionTest/CMakeLists.txt | 12 | ||||
-rw-r--r-- | Tests/FunctionTest/SubDirScope/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/FunctionTest/Util.cmake | 3 |
3 files changed, 10 insertions, 9 deletions
diff --git a/Tests/FunctionTest/CMakeLists.txt b/Tests/FunctionTest/CMakeLists.txt index 1efdef1..91f51b6 100644 --- a/Tests/FunctionTest/CMakeLists.txt +++ b/Tests/FunctionTest/CMakeLists.txt @@ -46,7 +46,7 @@ Test_Argn_Function(ignored 3) # test argument naming and raise scope function(track_find_variable cache_variable is_changed) - raise_scope("${is_changed}" changed) + set("${is_changed}" changed PARENT_SCOPE) endfunction(track_find_variable) track_find_variable(testvar is_changed) if ("${is_changed}" STREQUAL changed) @@ -65,7 +65,7 @@ endif (tester_res STREQUAL "${CMAKE_CURRENT_LIST_FILE}") -# test recursion and return via raise_scope +# test recursion and return via set(... PARENT_SCOPE) function (factorial argument result) if (argument LESS 2) set (lresult 1) @@ -74,7 +74,7 @@ function (factorial argument result) factorial (${temp} tresult) math (EXPR lresult "${argument}*${tresult}") endif (argument LESS 2) - raise_scope ("${result}" "${lresult}") + set ("${result}" "${lresult}" PARENT_SCOPE) endfunction (factorial) factorial (5 fresult) @@ -88,8 +88,9 @@ endif (fresult EQUAL 120) # case test FUNCTION(strange_function m) - RAISE_SCOPE("${m}" strange_function) + SET("${m}" strange_function PARENT_SCOPE) ENDFUNCTION(strange_function m) + STRANGE_FUNCTION(var) set(second_var "second_var") IF("${var}" STREQUAL "strange_function" AND "${second_var}" STREQUAL "second_var") @@ -105,8 +106,9 @@ ENDFUNCTION(ADD_EXECUTABLE) # var undef case FUNCTION(undef_var m) - RAISE_SCOPE("${m}") + SET("${m}" PARENT_SCOPE) ENDFUNCTION(undef_var) + SET(FUNCTION_UNDEFINED 1) undef_var(FUNCTION_UNDEFINED) IF(DEFINED FUNCTION_UNDEFINED) diff --git a/Tests/FunctionTest/SubDirScope/CMakeLists.txt b/Tests/FunctionTest/SubDirScope/CMakeLists.txt index 9241941..b67d30e 100644 --- a/Tests/FunctionTest/SubDirScope/CMakeLists.txt +++ b/Tests/FunctionTest/SubDirScope/CMakeLists.txt @@ -1,4 +1,4 @@ SET(SUBDIR_DEFINED 1) SET(SUBDIR_UNDEFINED) -RAISE_SCOPE(SUBDIR_DEFINED ${SUBDIR_DEFINED}) -RAISE_SCOPE(SUBDIR_UNDEFINED ${SUBDIR_UNDEFINED}) +SET(SUBDIR_DEFINED ${SUBDIR_DEFINED} PARENT_SCOPE) +SET(SUBDIR_UNDEFINED ${SUBDIR_UNDEFINED} PARENT_SCOPE) diff --git a/Tests/FunctionTest/Util.cmake b/Tests/FunctionTest/Util.cmake index 2b40cdf..f0c73b5 100644 --- a/Tests/FunctionTest/Util.cmake +++ b/Tests/FunctionTest/Util.cmake @@ -1,4 +1,3 @@ function(tester) - set (tester_res "${CMAKE_CURRENT_LIST_FILE}") - raise_scope(tester_res) + set (tester_res "${CMAKE_CURRENT_LIST_FILE}" PARENT_SCOPE) endfunction(tester) |