From 8a91da6abab2a8f00e215088150dd7d04417bce1 Mon Sep 17 00:00:00 2001 From: mpa Date: Wed, 6 Nov 2013 10:20:56 +0000 Subject: [PATCH] CMake: - add new macro SALOME_GENERATE_TESTS_ENVIRONMENT which generates environment variable for using given environment to run tests. --- salome_adm/cmake_files/SalomeMacros.cmake | 29 +++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index 8dac560f0..ea9604d2a 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -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 variable to use given environment to run some tests. +# Macro generates environement variable using previously created variables +# _${PROJECT_NAME}_EXTRA_ENV_, where is name of variable and +# _${PROJECT_NAME}_EXTRA_ENV (see marco SALOME_ACCUMULATE_ENVIRONMENT); +# and puts this variable into 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() # -- 2.39.2