handle common install paths for catch.hpp

This commit is contained in:
Mirko Scholz 2020-09-04 21:13:26 +02:00
parent bb7deb53cb
commit ae9beb120a

View File

@ -1,3 +1,10 @@
add_library(Catch INTERFACE)
if(EXISTS /usr/include/catch/catch.hpp)
target_include_directories(Catch INTERFACE /usr/include/catch)
elseif(EXISTS /usr/include/catch2/catch.hpp)
target_include_directories(Catch INTERFACE /usr/include/catch2)
else()
endif()
#code coverage
add_library(coverage_config INTERFACE)
@ -12,10 +19,10 @@ add_library(decn_cover decn.c)
target_link_libraries(decn_cover PUBLIC coverage_config)
add_executable(decn_test decn_test.c ../utils.c)
target_link_libraries(decn_test decn_cover coverage_config)
target_link_libraries(decn_test decn_cover coverage_config Catch)
add_executable(decn_tests catch_main.cpp decn_tests.cpp ../utils.c)
target_link_libraries(decn_tests decn_cover coverage_config mpfr)
target_link_libraries(decn_tests decn_cover coverage_config mpfr Catch)
# decn prototyping
add_subdirectory(proto)