diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e004fc..3b1d50a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,12 @@ # 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_policy(VERSION 3.1.0) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}