[cmake-commits] alex committed CMakeLists.txt 1.3 1.4 Util.cmake 1.1
1.2
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Jan 18 15:52:56 EST 2008
Update of /cvsroot/CMake/CMake/Tests/FunctionTest
In directory public:/mounts/ram/cvs-serv32005/Tests/FunctionTest
Modified Files:
CMakeLists.txt Util.cmake
Log Message:
ENH: remove RAISE_SCOPE() again and instead add SET(<var> <value> PARENT_SCOPE)
Alex
Index: CMakeLists.txt
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/FunctionTest/CMakeLists.txt,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- CMakeLists.txt 3 Jan 2008 16:21:39 -0000 1.3
+++ CMakeLists.txt 18 Jan 2008 20:52:54 -0000 1.4
@@ -46,7 +46,7 @@
# 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 @@
-# 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 @@
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 @@
# 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 @@
# 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)
Index: Util.cmake
===================================================================
RCS file: /cvsroot/CMake/CMake/Tests/FunctionTest/Util.cmake,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Util.cmake 3 Jan 2008 16:22:33 -0000 1.1
+++ Util.cmake 18 Jan 2008 20:52:54 -0000 1.2
@@ -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)
More information about the Cmake-commits
mailing list