From: mpa Date: Tue, 29 Oct 2013 12:52:28 +0000 (+0000) Subject: CMake: X-Git-Tag: BR_hydro_v_0_3_1~48 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=ee7d65591ded48948f5eecd2a20749091d316b6b;p=modules%2Fkernel.git CMake: - some edit of accumulate environment macro --- diff --git a/salome_adm/cmake_files/SalomeMacros.cmake b/salome_adm/cmake_files/SalomeMacros.cmake index 3c1f325bb..4d1bc6a1b 100755 --- a/salome_adm/cmake_files/SalomeMacros.cmake +++ b/salome_adm/cmake_files/SalomeMacros.cmake @@ -657,9 +657,19 @@ ENDMACRO(SALOME_ACCUMULATE_HEADERS) # MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar) FOREACH(_item ${ARGN}) - LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res) - IF(_res EQUAL -1) - LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item}) + IF(EXISTS ${_item}) + IF(IS_DIRECTORY ${_item}) + LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res) + IF(_res EQUAL -1) + LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item}) + ENDIF() + ELSE() + GET_FILENAME_COMPONENT(_path_dir ${_item} PATH) + LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_path_dir} _res) + IF(_res EQUAL -1) + LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_path_dir}) + ENDIF() + ENDIF() ENDIF() ENDFOREACH() LIST(FIND _${PROJECT_NAME}_EXTRA_ENV ${envvar} _res)