summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2016-01-13 23:24:44 +0100
committerFlorent Le Coz <louiz@louiz.org>2016-01-13 16:14:10 +0100
commit3497b330dc4aa848582da085e94ac20e6871731e (patch)
treeedae60f854dcb8682f217790a31e83132f232daf /CMakeLists.txt
parent5da0158fdb4a77512555a82ead49b7e794824e3b (diff)
downloadbiboumi-3497b330dc4aa848582da085e94ac20e6871731e.tar.gz
biboumi-3497b330dc4aa848582da085e94ac20e6871731e.tar.bz2
biboumi-3497b330dc4aa848582da085e94ac20e6871731e.tar.xz
biboumi-3497b330dc4aa848582da085e94ac20e6871731e.zip
If catch.hpp is found in tests/, use it without cloning the git repo
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt13
1 files changed, 8 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f38d5d6..562b21f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -169,6 +169,7 @@ if(USE_DATABASE)
target_link_libraries(test_suite
database)
endif()
+
include(ExternalProject)
ExternalProject_Add(catch
GIT_REPOSITORY "https://github.com/philsquared/Catch.git"
@@ -177,13 +178,15 @@ ExternalProject_Add(catch
CONFIGURE_COMMAND ""
BUILD_COMMAND ""
INSTALL_COMMAND ""
-)
+ )
set_target_properties(catch PROPERTIES EXCLUDE_FROM_ALL TRUE)
ExternalProject_Get_Property(catch SOURCE_DIR)
-target_include_directories(test_suite
- PUBLIC "${SOURCE_DIR}/include/"
-)
-add_dependencies(test_suite catch)
+if(NOT EXISTS ${CMAKE_SOURCE_DIR}/tests/catch.hpp)
+ target_include_directories(test_suite
+ PUBLIC "${SOURCE_DIR}/include/"
+ )
+ add_dependencies(test_suite catch)
+endif()
add_custom_target(check COMMAND "test_suite"
DEPENDS test_suite)