CMake: reject in-tree builds.
We do not support clobbering the source tree with build products, nor recommend this in any documentation, and this already leads to weird bugs with the resource system. Show an explicit error in this case to avoid confusion.
This commit is contained in:
parent
b846401c73
commit
d151eb56fc
|
@ -1,5 +1,12 @@
|
||||||
# cmake configuration
|
# cmake configuration
|
||||||
|
|
||||||
|
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
|
||||||
|
message(FATAL_ERROR
|
||||||
|
"In-tree builds are not supported; please perform an out-of-tree build:\n"
|
||||||
|
" rm -rf CMakeCache.txt CMakeFiles/\n"
|
||||||
|
" mkdir build && cd build && cmake ..")
|
||||||
|
endif()
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
||||||
cmake_policy(VERSION 3.1.0)
|
cmake_policy(VERSION 3.1.0)
|
||||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user