- some edit of accumulate environment macro
#
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)