mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-25 23:06:10 +01:00
Allow in-tree builds where Catch2 is just a subproject
Closes #1773 Closes #1774
This commit is contained in:
parent
ae14a47360
commit
01ef7076f5
@ -6,12 +6,16 @@ if(NOT DEFINED PROJECT_NAME)
|
|||||||
set(NOT_SUBPROJECT ON)
|
set(NOT_SUBPROJECT ON)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
project(Catch2 LANGUAGES CXX VERSION 2.10.0)
|
# Catch2's build breaks if done in-tree. You probably should not build
|
||||||
|
# things in tree anyway, but we can allow projects that include Catch2
|
||||||
if (CMAKE_BINARY_DIR STREQUAL CMAKE_SOURCE_DIR)
|
# as a subproject to build in-tree as long as it is not in our tree.
|
||||||
|
if (CMAKE_BINARY_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
|
||||||
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
|
message(FATAL_ERROR "Building in-source is not supported! Create a build dir and remove ${CMAKE_SOURCE_DIR}/CMakeCache.txt")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
project(Catch2 LANGUAGES CXX VERSION 2.10.0)
|
||||||
|
|
||||||
# Provide path for scripts
|
# Provide path for scripts
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMake")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user