From 2038c311001982dba100d33a6fbb8797f9de1c87 Mon Sep 17 00:00:00 2001 From: Naios Date: Thu, 14 Apr 2016 20:30:31 +0200 Subject: 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 (cherry picked from commit 42eeb28a8b9c1f3ae2d667e4238e956a4a95bd6c) --- cmake/macros/ConfigureScripts.cmake | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'cmake/macros') 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 @@ -8,6 +8,21 @@ # 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(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) -- cgit v1.2.3