From bfb4ee1597ca5448f567f349c54654e0616aef26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Janiszewski?= Date: Tue, 21 May 2019 06:38:06 +0200 Subject: [PATCH 1/2] Prevent building in source dir Fixes #1636 --- CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index e2329c69..cbc091c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,6 +8,10 @@ endif() project(Catch2 LANGUAGES CXX VERSION 2.7.2) +if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR) + message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt") +endif() + # Provide path for scripts list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake") From 90378f4a59fa64d6a00da7dfa8b73467e3db4e23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Thu, 23 May 2019 14:29:45 +0200 Subject: [PATCH 2/2] Have conan test-build the package in a separate subdirectory --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index a7cebb92..8d407baf 100644 --- a/conanfile.py +++ b/conanfile.py @@ -18,7 +18,7 @@ class CatchConan(ConanFile): cmake.definitions["BUILD_TESTING"] = "OFF" cmake.definitions["CATCH_INSTALL_DOCS"] = "OFF" cmake.definitions["CATCH_INSTALL_HELPERS"] = "ON" - cmake.configure() + cmake.configure(build_folder='build') cmake.install() self.copy(pattern="LICENSE.txt", dst="licenses")