Commit 3497b330 authored by louiz’'s avatar louiz’

If catch.hpp is found in tests/, use it without cloning the git repo

parent 5da0158f
...@@ -169,6 +169,7 @@ if(USE_DATABASE) ...@@ -169,6 +169,7 @@ if(USE_DATABASE)
target_link_libraries(test_suite target_link_libraries(test_suite
database) database)
endif() endif()
include(ExternalProject) include(ExternalProject)
ExternalProject_Add(catch ExternalProject_Add(catch
GIT_REPOSITORY "https://github.com/philsquared/Catch.git" GIT_REPOSITORY "https://github.com/philsquared/Catch.git"
...@@ -177,13 +178,15 @@ ExternalProject_Add(catch ...@@ -177,13 +178,15 @@ ExternalProject_Add(catch
CONFIGURE_COMMAND "" CONFIGURE_COMMAND ""
BUILD_COMMAND "" BUILD_COMMAND ""
INSTALL_COMMAND "" INSTALL_COMMAND ""
) )
set_target_properties(catch PROPERTIES EXCLUDE_FROM_ALL TRUE) set_target_properties(catch PROPERTIES EXCLUDE_FROM_ALL TRUE)
ExternalProject_Get_Property(catch SOURCE_DIR) ExternalProject_Get_Property(catch SOURCE_DIR)
target_include_directories(test_suite if(NOT EXISTS ${CMAKE_SOURCE_DIR}/tests/catch.hpp)
PUBLIC "${SOURCE_DIR}/include/" target_include_directories(test_suite
) PUBLIC "${SOURCE_DIR}/include/"
add_dependencies(test_suite catch) )
add_dependencies(test_suite catch)
endif()
add_custom_target(check COMMAND "test_suite" add_custom_target(check COMMAND "test_suite"
DEPENDS test_suite) DEPENDS test_suite)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment