From 50ea4b05e9b1d599a06e1fb22e5658695cc1f24c Mon Sep 17 00:00:00 2001 From: Niels Moseley Date: Thu, 2 May 2024 11:31:31 +0200 Subject: [PATCH] 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. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fa15835..a4055dc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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)