diff --git a/CMakeLists.txt b/CMakeLists.txt index 36556911c..f1293ba33 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,11 @@ cmake_minimum_required(VERSION 2.8) + +if( CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE ) + message(FATAL_ERROR "In-source builds are not allowed. +Please create a directory and run cmake from there, passing the path to this source directory as the last argument. +This process created the file `CMakeCache.txt' and the directory `CMakeFiles'. Please delete them.") +endif() + project(OSRM) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) include(CheckCXXCompilerFlag)