From 25f913e200de185aec7bf33d70c4b3dd278b2f6a Mon Sep 17 00:00:00 2001 From: Tiago Date: Wed, 16 Aug 2017 18:38:47 -0700 Subject: [PATCH] Fix catch installation issue (#540) Catch was being installed to the root of the cmake project. This violated the source code tree itself and would not work at all if GSL was being consumed with add_subdirectory. CMake will now install catch to the build tree under /dependencies. --- .gitignore | 1 - tests/CMakeLists.txt | 7 ++++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index cbb4a5c..326971f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,5 @@ CMakeFiles build -include/catch tests/CMakeFiles tests/Debug *.opensdf diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5306e85..a142174 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,7 +6,7 @@ project(GSLTests CXX) set_property(GLOBAL PROPERTY USE_FOLDERS ON) list(APPEND CATCH_CMAKE_ARGS - "-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}" + "-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external" "-DNO_SELFTEST=true" ) @@ -48,6 +48,11 @@ target_compile_options(gsl_tests_config INTERFACE > ) +# for tests to find the catch header +target_include_directories(gsl_tests_config INTERFACE + ${CMAKE_BINARY_DIR}/external/include +) + # set definitions for tests target_compile_definitions(gsl_tests_config INTERFACE GSL_THROW_ON_CONTRACT_VIOLATION