Skip to content

Commit 5f68a66

Browse files
russkeldtrugman
authored andcommitted
fix: set target_include_directory
1 parent bb0be73 commit 5f68a66

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

CMakeLists.txt

+5-2
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ option (pfs_BUILD_TESTS "Build tests" ON)
3333

3434
add_compile_options (-std=c++11 -Wall -Wextra -pedantic -Werror)
3535

36-
include_directories (include)
37-
3836
set (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out)
3937
set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
4038
set (CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
@@ -45,6 +43,11 @@ aux_source_directory (${pfs_ROOT_SOURCE_DIR}/parsers pfs_PARSERS_SOURCES)
4543
set (SOURCES ${pfs_ROOT_SOURCES} ${pfs_PARSERS_SOURCES})
4644

4745
add_library (pfs ${pfs_SHARED_OR_STATIC} ${SOURCES})
46+
target_include_directories(
47+
pfs PUBLIC
48+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
49+
$<INSTALL_INTERFACE:include>
50+
)
4851

4952
if (pfs_BUILD_COVERAGE)
5053
set (pfs_BUILD_COVERAGE_FLAGS -O0 --coverage)

0 commit comments

Comments
 (0)