0028027: Configuration - option BUILD_RESOURCES does not work on CMake 2.8
authorski <ski@opencascade.com>
Mon, 31 Oct 2016 08:54:54 +0000 (11:54 +0300)
committerapn <apn@opencascade.com>
Tue, 8 Nov 2016 12:15:25 +0000 (15:15 +0300)
CMake command "string (APPEND ...)" was replaced by SET equivalent to support CMake 2.8

adm/cmake/occt_resources.cmake

index 70fa0bf..7a88051 100644 (file)
@@ -39,18 +39,17 @@ macro (OCCT_GENERATE_CONTENT_ONLY CurrentResource)
           message(STATUS "Info. Generating header file from resource file: ${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}")
 
           # generate content for header file
-          set (OCCT_HEADER_FILE_CONTENT)
-          string (APPEND OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file src/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
+          set (OCCT_HEADER_FILE_CONTENT "// This file has been automatically generated from resource file src/${CurrentResource_Directory}/${RESOURCE_FILE}\n\n")
 
           # read resource file
           file (STRINGS "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${RESOURCE_FILE}" RESOURCE_FILE_LINES_LIST)
 
-          string (APPEND OCCT_HEADER_FILE_CONTENT "static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
+          set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}static const char ${CurrentResource_Directory}_${CurrentResource_FileName}[] =")
           foreach (line IN LISTS RESOURCE_FILE_LINES_LIST)
             string (REPLACE "\"" "\\\"" line "${line}")
-            string (APPEND OCCT_HEADER_FILE_CONTENT "\n  \"${line}\\n\"")
+            set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT}\n  \"${line}\\n\"")
           endforeach()
-          string (APPEND OCCT_HEADER_FILE_CONTENT ";")
+          set (OCCT_HEADER_FILE_CONTENT "${OCCT_HEADER_FILE_CONTENT};")
 
           # Save generated content to header file
           set (HEADER_FILE "${CMAKE_SOURCE_DIR}/src/${CurrentResource_Directory}/${HEADER_FILE_NAME}")