cmake: fatal error when path contains some parenthesis

This commit is contained in:
Gregory Hainaut 2014-03-30 16:25:11 +02:00
parent b020bd76c6
commit 22e02b545e
2 changed files with 8 additions and 3 deletions

View File

@ -87,12 +87,11 @@ set(CMAKE_POSITION_INDEPENDENT_CODE OFF)
# set module path # set module path
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake) set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# include some generic functions # include some generic functions to ensure correctness of the env
include(Pcsx2Utils) include(Pcsx2Utils)
# Detect current OS check_no_parenthesis_in_path()
detectOperatingSystem() detectOperatingSystem()
check_compiler_version("4.7" "4.5") check_compiler_version("4.7" "4.5")
#------------------------------------------------------------------------------- #-------------------------------------------------------------------------------

View File

@ -67,3 +67,9 @@ function(check_compiler_version version_warn version_err)
endif() endif()
endif() endif()
endfunction() endfunction()
function(check_no_parenthesis_in_path)
if ("${CMAKE_BINARY_DIR}" MATCHES "[()]" OR "${CMAKE_SOURCE_DIR}" MATCHES "[()]")
message(FATAL_ERROR "Your path contains some parenthesis. Unfortunately Cmake doesn't support them correctly.\nPlease rename your directory to avoid '(' and ')' characters\n")
endif()
endfunction()