Skip to content

Commit 7f9ffc4

Browse files
committed
cmake/modules: use FILE_SET to provide include directories
The `BASE_DIRS` missing caused the `target_include_directories` command to be required. Instead, specify the base directory to move the subdirectory to the `-I` flag instead.
1 parent f3f5588 commit 7f9ffc4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ if(CTRE_MODULE)
3838
add_library(${PROJECT_NAME})
3939

4040
target_sources(${PROJECT_NAME} PUBLIC FILE_SET CXX_MODULES TYPE CXX_MODULES FILES ctre.cppm)
41-
target_sources(${PROJECT_NAME} PUBLIC FILE_SET HEADERS TYPE HEADERS FILES
41+
target_sources(${PROJECT_NAME} PUBLIC FILE_SET HEADERS TYPE HEADERS
42+
BASE_DIRS
43+
"${CMAKE_CURRENT_SOURCE_DIR}/include"
44+
FILES
4245
include/ctll.hpp
4346
include/ctre/functions.hpp
4447
include/ctre/utility.hpp
@@ -96,7 +99,6 @@ if(CTRE_MODULE)
9699
set(CTRE_CXX_STANDARD 23)
97100
endif()
98101

99-
target_include_directories(${PROJECT_NAME} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/include)
100102
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_${CTRE_CXX_STANDARD})
101103
else()
102104
message(FATAL_ERROR "unsupported cmake for c++ modules")

0 commit comments

Comments
 (0)