diff options
author | John MacFarlane <jgm@berkeley.edu> | 2014-11-06 22:33:38 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2014-11-06 22:33:38 -0800 |
commit | 493abc5dc1952537707846294571671a4f35a6a5 (patch) | |
tree | b596512f251cabb59fc54e871de0c0b8ea7f2f91 /CMakeLists.txt | |
parent | 48c64a6ce073fbc4e42761a32840ec1a7def4555 (diff) |
cmake: Give fatal error on in-source build.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 36d2e67..20cd5da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,10 @@ project(cmark) cmake_minimum_required(VERSION 2.8) +if("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}") + message(FATAL_ERROR "Do not build in-source.\nPlease remove CMakeCache.txt and the CMakeFiles/ directory.\nThen: mkdir build ; cd build ; cmake .. ; make") +endif() + set(PROJECT_NAME "cmark") set(PROJECT_VERSION_MAJOR 0) |