Commit f5cf3313f6e6aeed97e1fcbc4198d26abd209dbb

Angelo Haller 2022-12-01T14:05:37

Fix CMake include directive when using wrappers like meson.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 27f9030..9066e65 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -5,7 +5,10 @@ set(sources dlfcn.c)
 add_library(dl ${sources})
 
 # Correctly export the location of installed includes in the target
-target_include_directories(dl INTERFACE $<INSTALL_INTERFACE:include>)
+target_include_directories(dl
+  PUBLIC
+    $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
+    $<INSTALL_INTERFACE:include>)
 
 # dot not add -D<target>_EXPORTS
 set_target_properties(dl PROPERTIES DEFINE_SYMBOL "")