]> SALOME platform Git repositories - tools/configuration.git/commitdiff
Salome HOME
bos #29682 Directories may contain spaces and parentheses
authorvsr <vsr@opencascade.com>
Tue, 12 Apr 2022 16:40:56 +0000 (19:40 +0300)
committervsr <vsr@opencascade.com>
Tue, 12 Apr 2022 16:40:56 +0000 (19:40 +0300)
cmake/SalomeMacros.cmake

index ed1ca49de9196a46bf4a3c6c4ec7eba6a88088e5..a915cac639aaf9e82e44b0fe98ebc10db6f099b4 100644 (file)
@@ -753,32 +753,32 @@ ENDMACRO(SALOME_ACCUMULATE_HEADERS)
 MACRO(SALOME_ACCUMULATE_ENVIRONMENT envvar)
   SET(_is_check ON)
   FOREACH(_item ${ARGN})
-    IF(${_item} STREQUAL "NOCHECK")
+    IF("${_item}" STREQUAL "NOCHECK")
       SET(_is_check OFF)
-    ELSEIF(${_item} STREQUAL "CHECK")
+    ELSEIF("${_item}" STREQUAL "CHECK")
       SET(_is_check ON)
     ELSE()
       IF(_is_check)
-        IF(NOT IS_DIRECTORY ${_item})
-          IF(TARGET ${_item})
-            GET_TARGET_PROPERTY(_target_type ${_item} TYPE)
+        IF(NOT IS_DIRECTORY "${_item}")
+          IF(TARGET "${_item}")
+            GET_TARGET_PROPERTY(_target_type "${_item}" TYPE)
             IF(NOT ${_target_type} STREQUAL "INTERFACE_LIBRARY")
-              GET_TARGET_PROPERTY(_item ${_item} LOCATION)
+              GET_TARGET_PROPERTY(_item "${_item}" LOCATION)
             ENDIF()
           ENDIF()
-          GET_FILENAME_COMPONENT(_item ${_item} PATH)
+          GET_FILENAME_COMPONENT(_item "${_item}" PATH)
         ENDIF()    
-        IF(EXISTS ${_item})
-          STRING(REGEX MATCH "^(/usr|/lib|/bin)" _usr_find ${_item})
-          LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res)
+        IF(EXISTS "${_item}")
+          STRING(REGEX MATCH "^(/usr|/lib|/bin)" _usr_find "${_item}")
+          LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} "${_item}" _res)
           IF(NOT _usr_find AND _res EQUAL -1)
-              LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item})
+              LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} "${_item}")
           ENDIF()  
         ENDIF()
       ELSE(_is_check)
-        LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item} _res)
+        LIST(FIND _${PROJECT_NAME}_EXTRA_ENV_${envvar} "${_item}" _res)
         IF( _res EQUAL -1)
-          LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} ${_item})
+          LIST(APPEND _${PROJECT_NAME}_EXTRA_ENV_${envvar} "${_item}")
         ENDIF()  
       ENDIF(_is_check)
     ENDIF()