From 86344e184348c8efc1e00d5e297682a8dcf4b6fc Mon Sep 17 00:00:00 2001 From: Naios Date: Tue, 12 Apr 2016 22:23:40 +0200 Subject: Core/Build: Workarround for different path handling in CMake < 3.2 * Closes #16951 (cherry picked from commit 81cee237758e5e83ae58efbb5bf7e6ca819dfe0e) --- cmake/macros/ConfigureScripts.cmake | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'cmake/macros/ConfigureScripts.cmake') 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) -- cgit v1.2.3