mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-03 17:56:43 -05:00
Allow to use system version of the catch test framework (#549)
This commit is contained in:
parent
80aa4b0c54
commit
e249f861e3
@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.1.3)
|
|||||||
project(GSL CXX)
|
project(GSL CXX)
|
||||||
|
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
find_package(Git REQUIRED)
|
find_package(Git)
|
||||||
|
|
||||||
# creates a library GSL which is an interface (header files only)
|
# creates a library GSL which is an interface (header files only)
|
||||||
add_library(GSL INTERFACE)
|
add_library(GSL INTERFACE)
|
||||||
|
@ -10,6 +10,7 @@ list(APPEND CATCH_CMAKE_ARGS
|
|||||||
"-DNO_SELFTEST=true"
|
"-DNO_SELFTEST=true"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(GIT_FOUND)
|
||||||
# add catch
|
# add catch
|
||||||
ExternalProject_Add(
|
ExternalProject_Add(
|
||||||
catch
|
catch
|
||||||
@ -20,6 +21,10 @@ ExternalProject_Add(
|
|||||||
LOG_DOWNLOAD 1
|
LOG_DOWNLOAD 1
|
||||||
UPDATE_DISCONNECTED 1
|
UPDATE_DISCONNECTED 1
|
||||||
)
|
)
|
||||||
|
else()
|
||||||
|
# assume catch is installed in a system directory
|
||||||
|
add_custom_target(catch)
|
||||||
|
endif()
|
||||||
|
|
||||||
# this interface adds compile options to how the tests are run
|
# this interface adds compile options to how the tests are run
|
||||||
# please try to keep entries ordered =)
|
# please try to keep entries ordered =)
|
||||||
|
Loading…
Reference in New Issue
Block a user