Changeset View
Changeset View
Standalone View
Standalone View
games/spring/files/patch-rts-build-cmake-Util
Modified for CMake 3.12 to drop FOLLOW_SYMLINKS in file(GLOB ...). | |||||
Obtained via: https://springrts.com/mantis/view.php?id=4679 | Obtained via: https://springrts.com/mantis/view.php?id=4679 | ||||
From 9e0db5f602407de4e7875ca85761b41782c1bb9c Mon Sep 17 00:00:00 2001 | From 9e0db5f602407de4e7875ca85761b41782c1bb9c Mon Sep 17 00:00:00 2001 | ||||
From: Johan Rehnberg <cleanrock@gmail.com> | From: Johan Rehnberg <cleanrock@gmail.com> | ||||
Date: Wed, 31 Dec 2014 11:35:19 +0100 | Date: Wed, 31 Dec 2014 11:35:19 +0100 | ||||
Subject: [PATCH] fix GetListOfSubModules to support GLOB returning both "//" | Subject: [PATCH] fix GetListOfSubModules to support GLOB returning both "//" | ||||
and "/" | and "/" | ||||
I needed this when building on archlinux with cmake 3.1.0 where GLOB returns "/" | I needed this when building on archlinux with cmake 3.1.0 where GLOB returns "/" | ||||
... | ... | ||||
--- rts/build/cmake/Util.cmake | --- rts/build/cmake/Util.cmake.orig 2014-10-07 20:09:51 UTC | ||||
+++ rts/build/cmake/Util.cmake | +++ rts/build/cmake/Util.cmake | ||||
@@ -166,10 +166,11 @@ EndFunction (MakeGlobal) | @@ -165,11 +165,12 @@ EndFunction (MakeGlobal) | ||||
# Find all CMakeLists.txt files in sub-directories | # Find all CMakeLists.txt files in sub-directories | ||||
Macro (GetListOfSubModules list_var) | Macro (GetListOfSubModules list_var) | ||||
File(GLOB ${list_var} RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" FOLLOW_SYMLINKS "${CMAKE_CURRENT_SOURCE_DIR}/*/CMakeLists.txt") | - File(GLOB ${list_var} RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" FOLLOW_SYMLINKS "${CMAKE_CURRENT_SOURCE_DIR}/*/CMakeLists.txt") | ||||
- | - | ||||
+ File(GLOB ${list_var} RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/*/CMakeLists.txt") | |||||
# Strip away the "/CMakeLists.txt" parts, so we end up with just a list of dirs, | # Strip away the "/CMakeLists.txt" parts, so we end up with just a list of dirs, | ||||
# for example: AAI;RAI;KAIK | # for example: AAI;RAI;KAIK | ||||
- String(REPLACE "//CMakeLists.txt" "" ${list_var} "${${list_var}}") | - String(REPLACE "//CMakeLists.txt" "" ${list_var} "${${list_var}}") | ||||
+ # GLOB can prefix with "//" or "/" (perhaps changed in cmake 3.1.0), this double replace will support both "//" and "/" | + # GLOB can prefix with "//" or "/" (perhaps changed in cmake 3.1.0), this double replace will support both "//" and "/" | ||||
+ String(REPLACE "/CMakeLists.txt" "" ${list_var} "${${list_var}}") | + String(REPLACE "/CMakeLists.txt" "" ${list_var} "${${list_var}}") | ||||
+ String(REPLACE "/" "" ${list_var} "${${list_var}}") | + String(REPLACE "/" "" ${list_var} "${${list_var}}") | ||||
EndMacro (GetListOfSubModules list_var) | EndMacro (GetListOfSubModules list_var) | ||||