From 493abc5dc1952537707846294571671a4f35a6a5 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 6 Nov 2014 22:33:38 -0800 Subject: cmake: Give fatal error on in-source build. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'CMakeLists.txt') 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) -- cgit v1.2.3