]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CMake:
authormpa <mpa@opencascade.com>
Wed, 6 Nov 2013 10:20:56 +0000 (10:20 +0000)
committermpa <mpa@opencascade.com>
Wed, 6 Nov 2013 10:20:56 +0000 (10:20 +0000)
- add new macro SALOME_GENERATE_TESTS_ENVIRONMENT which generates environment variable for using given environment to run tests.

salome_adm/cmake_files/SalomeMacros.cmake

index 8dac560f026a9f7262f131c8e16cb152e35de2da..ea9604d2a39d0dcd7a69e22e60c9bfbda4631f5b 100755 (executable)
@@ -761,6 +761,35 @@ MACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT output script cmd opts)
   
 ENDMACRO(SALOME_GENERATE_ENVIRONMENT_SCRIPT)
 
+#########################################################################
+# SALOME_GENERATE_TESTS_ENVIRONMENT()
+# 
+# USAGE: SALOME_GENERATE_TESTS_ENVIRONMENT(output)
+#
+# ARGUMENTS:
+#   output [out] output environement variable.
+#
+# This macro generates <output> variable to use given environment to run some tests. 
+# Macro generates environement variable using previously created variables
+# _${PROJECT_NAME}_EXTRA_ENV_<var>, where <var> is name of variable and
+# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT);
+# and puts this variable into <output> argument.
+#
+MACRO(SALOME_GENERATE_TESTS_ENVIRONMENT output)
+  SET(_env)
+  FOREACH(_item ${_${PROJECT_NAME}_EXTRA_ENV})
+    FOREACH(_val ${_${PROJECT_NAME}_EXTRA_ENV_${_item}})
+      IF(WIN32)
+        SET(_env "${_val};${_env}")
+      ELSE()
+        SET(_env "${_val}:${_env}")
+      ENDIF()
+    ENDFOREACH()
+    SET(_env " ${_item}=${_env}")
+  ENDFOREACH() 
+  SET(${output} ${_env})  
+ENDMACRO(SALOME_GENERATE_TESTS_ENVIRONMENT)
+
 #########################################################################
 # SALOME_APPEND_LIST_OF_LIST()
 #