mirror of
https://github.com/microsoft/GSL.git
synced 2024-11-25 01:01:58 -05:00
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.
This commit is contained in:
parent
2b8d20425e
commit
25f913e200
1
.gitignore
vendored
1
.gitignore
vendored
@ -1,6 +1,5 @@
|
|||||||
CMakeFiles
|
CMakeFiles
|
||||||
build
|
build
|
||||||
include/catch
|
|
||||||
tests/CMakeFiles
|
tests/CMakeFiles
|
||||||
tests/Debug
|
tests/Debug
|
||||||
*.opensdf
|
*.opensdf
|
||||||
|
@ -6,7 +6,7 @@ project(GSLTests CXX)
|
|||||||
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
|
||||||
|
|
||||||
list(APPEND CATCH_CMAKE_ARGS
|
list(APPEND CATCH_CMAKE_ARGS
|
||||||
"-DCMAKE_INSTALL_PREFIX=${CMAKE_SOURCE_DIR}"
|
"-DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/external"
|
||||||
"-DNO_SELFTEST=true"
|
"-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
|
# set definitions for tests
|
||||||
target_compile_definitions(gsl_tests_config INTERFACE
|
target_compile_definitions(gsl_tests_config INTERFACE
|
||||||
GSL_THROW_ON_CONTRACT_VIOLATION
|
GSL_THROW_ON_CONTRACT_VIOLATION
|
||||||
|
Loading…
Reference in New Issue
Block a user