From 94cdea8444c52e14291ea4068cdc3df98f23f200 Mon Sep 17 00:00:00 2001 From: Martin Beseda <martin.beseda@vsb.cz> Date: Tue, 15 Jan 2019 16:16:46 +0100 Subject: [PATCH] ENH: Added check of the unallowed characters in the repo path. --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index c01c7655..82ab32dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -61,6 +61,14 @@ if(CMAKE_BUILD_TYPE MATCHES DEBUG) set(CMAKE_VERBOSE_MAKEFILE ON) endif() +#------------------------------------------------------------------------------------# +# Check, if the path to the current directory does contain some unallowed characters # +#------------------------------------------------------------------------------------# +string(REGEX MATCH "[A-Za-z0-9 \\\\/:_-]*" MATCH ${CMAKE_CURRENT_LIST_DIR}) +if (NOT ${MATCH} STREQUAL ${CMAKE_CURRENT_LIST_DIR}) + message(FATAL_ERROR "Illegal character(s) found in the path to the current directory!") +endif() + #-------------------------# # Find external libraries # #-------------------------# -- GitLab