Pre-emptively fix games/spring before CMake 3.12 arrives.

file(GLOB .. FOLLOW_SYMLINKS ..) was never documented to work; in
3.12-rc1 this has become an error. That in itself is considered
a regression in CMake [1], but the use is wrong anyway, so patch
it away. The change has been accepted upstream [2] already.

Not bumping PORTREVISION because no code actually changes,
it just removes a cmake-time no-op.

[1] https://gitlab.kitware.com/cmake/cmake/issues/18097
[2] https://springrts.com/mantis/view.php?id=6005

PR:		229101
Reviewed by:	tcberner
Differential Revision:	https://reviews.freebsd.org/D15878
This commit is contained in:
Adriaan de Groot 2018-06-19 21:08:33 +00:00
parent ac77375ae2
commit ec85543d07
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=472823
2 changed files with 23 additions and 3 deletions

View File

@ -1,3 +1,5 @@
Modified for CMake 3.12 to drop FOLLOW_SYMLINKS in file(GLOB ...).
Obtained via: https://springrts.com/mantis/view.php?id=4679
From 9e0db5f602407de4e7875ca85761b41782c1bb9c Mon Sep 17 00:00:00 2001
@ -10,13 +12,15 @@ 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
@@ -166,10 +166,11 @@ EndFunction (MakeGlobal)
@@ -165,11 +165,12 @@ EndFunction (MakeGlobal)
# Find all CMakeLists.txt files in sub-directories
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,
# for example: AAI;RAI;KAIK
- String(REPLACE "//CMakeLists.txt" "" ${list_var} "${${list_var}}")

View File

@ -0,0 +1,16 @@
CMake 3.12 errors on FOLLOW_SYMLINKS (which was never supported for
file(GLOB ...) anyway, but was ignored).
See also https://springrts.com/mantis/view.php?id=6005
--- ./rts/build/cmake/UtilJava.cmake.bak 2014-10-07 22:09:51 UTC
+++ ./rts/build/cmake/UtilJava.cmake
@@ -45,7 +45,7 @@
# Returns the name of the first sub-dir (in alphabetical descending order)
# under dir.
macro (GetFirstSubDirName name_var dir)
- file(GLOB dirContent RELATIVE "${dir}" FOLLOW_SYMLINKS "${dir}/*")
+ file(GLOB dirContent RELATIVE "${dir}" "${dir}/*")
foreach (dirPart ${dirContent})
if (IS_DIRECTORY "${dir}/${dirPart}")
set(${name_var} ${dirPart})