aboutsummaryrefslogtreecommitdiff
path: root/cmake
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:08:27 +0200
commit81cee237758e5e83ae58efbb5bf7e6ca819dfe0e (patch)
tree43b5e1cd64d9ad27562cb8dde8ab3d2aff4f2cb5 /cmake
parente2687b31ed737079204e36fec1c085240615af0d (diff)
Core/Build: Workarround for different path handling in CMake < 3.2
* Closes #16951
Diffstat (limited to 'cmake')
-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)