Commit 8dceebdac727a2f9d7022a71b7800589e662d9b8

Silvio Traversaro 2022-12-02T00:39:04

Merge pull request #106 from szanni/cmake-fix-wrapper-include 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 "")