]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
CMake:
authormpa <mpa@opencascade.com>
Tue, 29 Oct 2013 12:52:28 +0000 (12:52 +0000)
committermpa <mpa@opencascade.com>
Tue, 29 Oct 2013 12:52:28 +0000 (12:52 +0000)
- some edit of accumulate environment macro

salome_adm/cmake_files/SalomeMacros.cmake

index 3c1f325bb13c63b0cafd87531414dc36772bbfbe..4d1bc6a1bdd4e4f9feb74b728dc627e170307680 100755 (executable)
@@ -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)