mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-16 18:52:25 +01:00
When used as subproject, treat Catch2 cmake target include paths as SYSTEM to avoid compiler warnings in Catch2 headers.
This commit is contained in:
parent
037ddbc75c
commit
92d827c1e9
@ -271,11 +271,20 @@ target_compile_features(Catch2
|
|||||||
cxx_variadic_macros
|
cxx_variadic_macros
|
||||||
)
|
)
|
||||||
|
|
||||||
target_include_directories(Catch2
|
|
||||||
PUBLIC
|
if (NOT_SUBPROJECT)
|
||||||
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
|
target_include_directories(Catch2
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
PUBLIC
|
||||||
)
|
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
|
||||||
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
target_include_directories(Catch2
|
||||||
|
SYSTEM PUBLIC
|
||||||
|
$<BUILD_INTERFACE:${SOURCES_DIR}/..>
|
||||||
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
add_library(Catch2WithMain STATIC
|
add_library(Catch2WithMain STATIC
|
||||||
|
Loading…
Reference in New Issue
Block a user