Changed INTERFACE location to CMAKE_CURRENT_SOURCE_DIR for package manager 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.
This commit is contained in:
Niels Moseley 2024-05-02 11:31:31 +02:00 committed by GitHub
parent f01a5e637e
commit 50ea4b05e9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -18,7 +18,7 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
endif() endif()
add_library(peglib INTERFACE) 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(BUILD_TESTS "Build cpp-peglib tests" ON)
option(PEGLIB_BUILD_LINT "Build cpp-peglib lint utility" OFF) option(PEGLIB_BUILD_LINT "Build cpp-peglib lint utility" OFF)