aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2016-04-12 22:23:40 +0200
committerNaios <naios-dev@live.de>2016-04-12 23:12:01 +0200
commit86344e184348c8efc1e00d5e297682a8dcf4b6fc (patch)
tree78d1251a2af75f9bea56efbf2aecae2c0ff9bb1f
parenta3936c143da76fb1eb785c6277e5aa0470b1cf33 (diff)
Core/Build: Workarround for different path handling in CMake < 3.2
* Closes #16951 (cherry picked from commit 81cee237758e5e83ae58efbb5bf7e6ca819dfe0e)
-rw-r--r--cmake/macros/ConfigureScripts.cmake18
1 files changed, 12 insertions, 6 deletions
diff --git a/cmake/macros/ConfigureScripts.cmake b/cmake/macros/ConfigureScripts.cmake
index c783cc98ab7..a6a39bd9306 100644
--- a/cmake/macros/ConfigureScripts.cmake
+++ b/cmake/macros/ConfigureScripts.cmake
@@ -8,6 +8,17 @@
# WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# Returns the base path to the script directory in the source directory
+function(GetScriptsBasePath variable)
+ set(${variable} "${CMAKE_SOURCE_DIR}/src/server/scripts" PARENT_SCOPE)
+endfunction()
+
+# Stores the absolut path of the given module in the variable
+function(GetPathToScriptModule module variable)
+ GetScriptsBasePath(SCRIPTS_BASE_PATH)
+ set(${variable} "${SCRIPTS_BASE_PATH}/${module}" PARENT_SCOPE)
+endfunction()
+
# Stores the project name of the given module in the variable
function(GetProjectNameOfScriptModule module variable)
string(TOLOWER "scripts_${SCRIPT_MODULE}" GENERATED_NAME)
@@ -17,7 +28,7 @@ endfunction()
# Creates a list of all script modules
# and stores it in the given variable.
function(GetScriptModuleList variable)
- GetPathToScriptModule("" BASE_PATH)
+ GetScriptsBasePath(BASE_PATH)
file(GLOB LOCALE_SCRIPT_MODULE_LIST RELATIVE
${BASE_PATH}
${BASE_PATH}/*)
@@ -59,11 +70,6 @@ function(IsDynamicLinkingRequired variable)
set(${variable} ${IS_REQUIRED} PARENT_SCOPE)
endfunction()
-# Stores the absolut path of the given module in the variable
-function(GetPathToScriptModule module variable)
- set(${variable} "${CMAKE_SOURCE_DIR}/src/server/scripts/${module}" PARENT_SCOPE)
-endfunction()
-
# Stores the native variable name
function(GetNativeSharedLibraryName module variable)
if(WIN32)