From: inv Date: Fri, 25 Oct 2013 17:12:34 +0000 (+0000) Subject: Synchronize adm files X-Git-Tag: V7_3_0a1~55 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=121fd628b80d988d5a3a010877120a5e23a28db6;p=modules%2Fmed.git Synchronize adm files --- diff --git a/adm_local_without_kernel/cmake_files/SalomeMacros.cmake b/adm_local_without_kernel/cmake_files/SalomeMacros.cmake index 29bca1f9f..ef8d8a3f1 100755 --- a/adm_local_without_kernel/cmake_files/SalomeMacros.cmake +++ b/adm_local_without_kernel/cmake_files/SalomeMacros.cmake @@ -636,3 +636,40 @@ MACRO(SALOME_ACCUMULATE_HEADERS lst) ENDIF() ENDFOREACH() ENDMACRO(SALOME_ACCUMULATE_HEADERS) + +######################################################################### +# SALOME_ACCUMULATE_ENVIRONMENT() +# +# USAGE: SALOME_ACCUMULATE_ENVIRONMENT(var value) +# +# ARGUMENTS: +# var [in] environment variable name, e.g. PATH +# value [in] value(s) to be added to environment variable +# +# This macro is called in the various FindSalomeXYZ.cmake modules to +# accumulate environment variables, to be used later to run some command +# in proper environment. +# +# 1. Each envrironment variable is stored in specific CMake variable +# _${PROJECT_NAME}_EXTRA_ENV_ +# where is name of variable. +# 2. Full list of environment variable names is stored in CMake variable +# _${PROJECT_NAME}_EXTRA_ENV. +# +MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar val) + FOREACH(_item ${val}) + LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res) + IF(_res EQUAL -1) + LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item}) + ENDIF() + ENDFOREACH() + LIST(FIND _${PROJECT_NAME}_EXTRA_ENV ${envvar} _res) + IF(_res EQUAL -1) + LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV ${envvar}) + ENDIF() + SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "SET\(${PROJECT_NAME}_EXTRA_ENV ${_${PROJECT_NAME}_EXTRA_ENV}\)") + FOREACH(_res ${_${PROJECT_NAME}_EXTRA_ENV}) + SET(_${PROJECT_NAME}_EXTRA_ENV_FULL "${_${PROJECT_NAME}_EXTRA_ENV_FULL}\nSET\(${PROJECT_NAME}_EXTRA_ENV_${_res} ${_${PROJECT_NAME}_EXTRA_ENV_${_res}}\)") + ENDFOREACH() +ENDMACRO(SALOME_ACCUMULATE_ENVIRONMENT) +