From 2f52a5d34fad81509fbc99379d37b60a19ac5cf9 Mon Sep 17 00:00:00 2001 From: Ronald Kinard Date: Sun, 8 Mar 2015 18:47:26 -0500 Subject: [PATCH] Added a fatal error message when attempting an in-source build. In-source builds are pain and suffering and I am going to stop people from doing them to save them that pain. --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 346fd8db0..e23d891cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,6 +3,10 @@ project(SRB2 VERSION 2.1.14 LANGUAGES C) +if(${PROJECT_SOURCE_DIR} MATCHES ${PROJECT_BINARY_DIR}) + message(FATAL_ERROR "In-source builds will bring you a world of pain. Please make a separate directory to invoke CMake from.") +endif() + # Set up CMAKE path set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")