Skip to content

Commit

Permalink
Changed INTERFACE location to CMAKE_CURRENT_SOURCE_DIR for package ma…
Browse files Browse the repository at this point in the history
…nager compatibility. (#298)

CMAKE_SOURCE_DIR points to the top-level CMakeLists.txt, not to the subdir CMakeLists.txt, so when cpp-peglib is included in a project, the INTERFACE/include directory points to the wrong location.
  • Loading branch information
trcwm committed May 2, 2024
1 parent f01a5e6 commit 50ea4b0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif()

add_library(peglib INTERFACE)
target_include_directories(peglib INTERFACE ${CMAKE_SOURCE_DIR})
target_include_directories(peglib INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})

option(BUILD_TESTS "Build cpp-peglib tests" ON)
option(PEGLIB_BUILD_LINT "Build cpp-peglib lint utility" OFF)
Expand Down

0 comments on commit 50ea4b0

Please sign in to comment.