Jelajahi Sumber

Start making use of CMake 3.4 string(APPEND)

Camilla Löwy 4 tahun lalu
induk
melakukan
8c8def5de5
3 mengubah file dengan 9 tambahan dan 9 penghapusan
  1. 6 6
      CMake/GenerateMappings.cmake
  2. 2 2
      CMakeLists.txt
  3. 1 1
      docs/CMakeLists.txt

+ 6 - 6
CMake/GenerateMappings.cmake

@@ -26,19 +26,19 @@ foreach(line ${lines})
     if (line MATCHES "^[0-9a-fA-F]")
     if (line MATCHES "^[0-9a-fA-F]")
         if (line MATCHES "platform:Windows")
         if (line MATCHES "platform:Windows")
             if (GLFW_WIN32_MAPPINGS)
             if (GLFW_WIN32_MAPPINGS)
-                set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\n")
+                string(APPEND GLFW_WIN32_MAPPINGS "\n")
             endif()
             endif()
-            set(GLFW_WIN32_MAPPINGS "${GLFW_WIN32_MAPPINGS}\"${line}\",")
+            string(APPEND GLFW_WIN32_MAPPINGS "\"${line}\",")
         elseif (line MATCHES "platform:Mac OS X")
         elseif (line MATCHES "platform:Mac OS X")
             if (GLFW_COCOA_MAPPINGS)
             if (GLFW_COCOA_MAPPINGS)
-                set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\n")
+                string(APPEND GLFW_COCOA_MAPPINGS "\n")
             endif()
             endif()
-            set(GLFW_COCOA_MAPPINGS "${GLFW_COCOA_MAPPINGS}\"${line}\",")
+            string(APPEND GLFW_COCOA_MAPPINGS "\"${line}\",")
         elseif (line MATCHES "platform:Linux")
         elseif (line MATCHES "platform:Linux")
             if (GLFW_LINUX_MAPPINGS)
             if (GLFW_LINUX_MAPPINGS)
-                set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\n")
+                string(APPEND GLFW_LINUX_MAPPINGS "\n")
             endif()
             endif()
-            set(GLFW_LINUX_MAPPINGS "${GLFW_LINUX_MAPPINGS}\"${line}\",")
+            string(APPEND GLFW_LINUX_MAPPINGS "\"${line}\",")
         endif()
         endif()
     endif()
     endif()
 endforeach()
 endforeach()

+ 2 - 2
CMakeLists.txt

@@ -256,10 +256,10 @@ endif()
 # Export GLFW library dependencies
 # Export GLFW library dependencies
 #--------------------------------------------------------------------
 #--------------------------------------------------------------------
 foreach(arg ${glfw_PKG_DEPS})
 foreach(arg ${glfw_PKG_DEPS})
-    set(deps "${deps} ${arg}")
+    string(APPEND deps " ${arg}")
 endforeach()
 endforeach()
 foreach(arg ${glfw_PKG_LIBS})
 foreach(arg ${glfw_PKG_LIBS})
-    set(libs "${libs} ${arg}")
+    string(APPEND libs " ${arg}")
 endforeach()
 endforeach()
 
 
 set(GLFW_PKG_CONFIG_REQUIRES_PRIVATE "${deps}" CACHE INTERNAL
 set(GLFW_PKG_CONFIG_REQUIRES_PRIVATE "${deps}" CACHE INTERNAL

+ 1 - 1
docs/CMakeLists.txt

@@ -21,7 +21,7 @@ set(GLFW_DOXYGEN_SOURCES
 
 
 # Format the source list into a Doxyfile INPUT value that Doxygen can parse
 # Format the source list into a Doxyfile INPUT value that Doxygen can parse
 foreach(path IN LISTS GLFW_DOXYGEN_SOURCES)
 foreach(path IN LISTS GLFW_DOXYGEN_SOURCES)
-    set(GLFW_DOXYGEN_INPUT "${GLFW_DOXYGEN_INPUT} \\\n\"${GLFW_SOURCE_DIR}/${path}\"")
+    string(APPEND GLFW_DOXYGEN_INPUT " \\\n\"${GLFW_SOURCE_DIR}/${path}\"")
 endforeach()
 endforeach()
 
 
 configure_file(Doxyfile.in Doxyfile @ONLY)
 configure_file(Doxyfile.in Doxyfile @ONLY)