File tree Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Expand file tree Collapse file tree 2 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,12 @@ include(cmake/CPM.cmake)
14
14
15
15
# Build the main library
16
16
add_library (errors src/error.cpp )
17
- target_include_directories (errors PUBLIC include )
17
+ target_sources (
18
+ errors PUBLIC
19
+ FILE_SET HEADERS
20
+ BASE_DIRS include
21
+ FILES include /errors/error.hpp
22
+ )
18
23
19
24
# Check if this project is the main project
20
25
if (NOT_SUBPROJECT )
@@ -41,11 +46,11 @@ if(NOT_SUBPROJECT)
41
46
42
47
# Append the main library properties instead of linking the library.
43
48
get_target_property (errors_SOURCES errors SOURCES )
44
- get_target_property (errors_INCLUDES errors INCLUDE_DIRECTORIES )
49
+ get_target_property (errors_HEADER_DIRS errors HEADER_DIRS )
45
50
46
51
# Build tests for the main library
47
52
add_executable (errors_test test /error_test.cpp ${errors_SOURCES} )
48
- target_include_directories (errors_test PRIVATE ${errors_INCLUDES } )
53
+ target_include_directories (errors_test PRIVATE ${errors_HEADER_DIRS } )
49
54
target_link_libraries (errors_test PRIVATE Catch2::Catch2WithMain )
50
55
51
56
# Enable support to check for test coverage
Original file line number Diff line number Diff line change 1
1
cpmaddpackage ("gh:fmtlib/fmt#10.0.0" )
2
2
3
3
add_library (errors_format src/format.cpp )
4
- target_include_directories (errors_format PUBLIC include )
4
+ target_sources (
5
+ errors_format PUBLIC
6
+ FILE_SET HEADERS
7
+ BASE_DIRS include
8
+ FILES include /errors/format.hpp
9
+ )
5
10
target_link_libraries (errors_format PUBLIC errors fmt )
6
11
7
12
if (NOT_SUBPROJECT )
8
13
if (BUILD_TESTING )
9
14
# Append the main library properties instead of linking the library.
10
15
get_target_property (errors_format_SOURCES errors_format SOURCES )
11
- get_target_property (errors_format_INCLUDES errors_format INCLUDE_DIRECTORIES )
16
+ get_target_property (errors_format_HEADER_DIRS errors_format HEADER_DIRS )
12
17
get_target_property (errors_format_LIBRARIES errors_format LINK_LIBRARIES )
13
18
14
19
# Build tests for the main library
15
20
add_executable (errors_format_test test /format_test.cpp ${errors_format_SOURCES} )
16
- target_include_directories (errors_format_test PRIVATE ${errors_format_INCLUDES } )
21
+ target_include_directories (errors_format_test PRIVATE ${errors_format_HEADER_DIRS } )
17
22
target_link_libraries (errors_format_test PRIVATE Catch2::Catch2WithMain ${errors_format_LIBRARIES} )
18
23
19
24
# Enable support to check for test coverage
You can’t perform that action at this time.
0 commit comments