aboutsummaryrefslogtreecommitdiff
path: root/cmake/macros/ConfigureScripts.cmake
diff options
context:
space:
mode:
authorNaios <naios-dev@live.de>2016-04-14 20:30:31 +0200
committerNaios <naios-dev@live.de>2016-04-14 20:31:04 +0200
commit42eeb28a8b9c1f3ae2d667e4238e956a4a95bd6c (patch)
tree9ef05f825964665689de53ef86d492125d58dcc2 /cmake/macros/ConfigureScripts.cmake
parent9e43e50fa78ec2e58fa6be52524a3d999f153870 (diff)
Core/Scripting: Disallow the build directory to contain spaces
* I wasn't able to work arround a path which contains spaces, since it seems like a CMake specific issue. * Closes #16947
Diffstat (limited to 'cmake/macros/ConfigureScripts.cmake')
-rw-r--r--cmake/macros/ConfigureScripts.cmake15
1 files changed, 15 insertions, 0 deletions
diff --git a/cmake/macros/ConfigureScripts.cmake b/cmake/macros/ConfigureScripts.cmake
index a6a39bd9306..5260d3a1afe 100644
--- a/cmake/macros/ConfigureScripts.cmake
+++ b/cmake/macros/ConfigureScripts.cmake
@@ -9,6 +9,21 @@
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# Returns the base path to the script directory in the source directory
+function(WarnAboutSpacesInBuildPath)
+ # Only check win32 since unix doesn't allow spaces in paths
+ if (WIN32)
+ string(FIND "${CMAKE_BINARY_DIR}" " " SPACE_INDEX_POS)
+
+ if (SPACE_INDEX_POS GREATER -1)
+ message("")
+ message(WARNING " *** WARNING!\n"
+ " *** Your selected build directory contains spaces!\n"
+ " *** Please note that this will cause issues!")
+ endif()
+ endif()
+endfunction()
+
+# 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()