File tree Expand file tree Collapse file tree 3 files changed +21
-7
lines changed
Expand file tree Collapse file tree 3 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
88project (cpp-sort VERSION 2.0.0 LANGUAGES CXX)
99
1010include (CMakePackageConfigHelpers)
11+ include (cpp-sort -utils)
1112include (GNUInstallDirs)
1213
1314# Project options
@@ -30,6 +31,7 @@ if (CPPSORT_USE_LIBASSERT)
3031 if (NOT libassert_POPULATED)
3132 FetchContent_Populate(libassert)
3233 add_subdirectory (${libassert_SOURCE_DIR} ${libassert_BINARY_DIR} )
34+ mark_system_library(libassert-lib)
3335 endif ()
3436endif ()
3537
Original file line number Diff line number Diff line change 1- # Copyright (c) 2019-2023 Morwenn
1+ # Copyright (c) 2019-2025 Morwenn
22# SPDX-License-Identifier: MIT
33
44# Add a selection of warnings to a target
@@ -15,3 +15,17 @@ macro(cppsort_add_warnings target)
1515 )
1616 endif ()
1717endmacro ()
18+
19+ # Mark a target as a SYSTEM library
20+ function (mark_system_library target )
21+ get_target_property (
22+ TARGET_INCLUDE_DIR
23+ ${target}
24+ INTERFACE_INCLUDE_DIRECTORIES
25+ )
26+ set_target_properties (
27+ ${target}
28+ PROPERTIES
29+ INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${TARGET_INCLUDE_DIR} "
30+ )
31+ endfunction ()
Original file line number Diff line number Diff line change 3232 FetchContent_Populate(Catch2)
3333 add_subdirectory (${catch2_SOURCE_DIR} ${catch2_BINARY_DIR} )
3434 list (APPEND CMAKE_MODULE_PATH ${catch2_SOURCE_DIR} /extras)
35- # Make Catch2::Catch2 a SYSTEM target
36- get_target_property (catch2_INCLUDE_DIRECTORY Catch2 INTERFACE_INCLUDE_DIRECTORIES )
37- set_target_properties (Catch2 PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${catch2_INCLUDE_DIRECTORY} " )
35+ mark_system_library(Catch2)
36+ mark_system_library(Catch2WithMain)
3837 endif ()
3938endif ()
4039include (Catch)
5958 FetchContent_Populate(RapidCheck)
6059 set (RC_INSTALL_ALL_EXTRAS ON )
6160 add_subdirectory (${rapidcheck_SOURCE_DIR} ${rapidcheck_BINARY_DIR} )
62- # Make rapidcheck a SYSTEM target
63- get_target_property (rapidcheck_INCLUDE_DIRECTORY rapidcheck INTERFACE_INCLUDE_DIRECTORIES )
64- set_target_properties (rapidcheck PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${rapidcheck_INCLUDE_DIRECTORY} " )
61+ mark_system_library(rapidcheck)
62+ mark_system_library(rapidcheck_catch)
6563 endif ()
6664endif ()
6765
You can’t perform that action at this time.
0 commit comments