Package: draco / 1.4.1+dfsg-3

0004-Install-proper-CMake-targets.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
From: =?utf-8?q?Timo_R=C3=B6hling?= <timo@gaussglocke.de>
Date: Wed, 2 Dec 2020 15:17:25 +0100
Subject: Install proper CMake targets

---
 cmake/draco-config.cmake.template | 3 ++-
 cmake/draco_install.cmake         | 8 ++++++--
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/cmake/draco-config.cmake.template b/cmake/draco-config.cmake.template
index ca4a456..1a46102 100644
--- a/cmake/draco-config.cmake.template
+++ b/cmake/draco-config.cmake.template
@@ -1,2 +1,3 @@
+include(${CMAKE_CURRENT_LIST_DIR}/draco-targets.cmake)
 set(DRACO_INCLUDE_DIRS "@DRACO_INCLUDE_DIRS@")
-set(DRACO_LIBRARIES "draco")
+set(DRACO_LIBRARIES "draco::draco_shared")
diff --git a/cmake/draco_install.cmake b/cmake/draco_install.cmake
index 71e665c..cca0646 100644
--- a/cmake/draco_install.cmake
+++ b/cmake/draco_install.cmake
@@ -59,12 +59,16 @@ macro(draco_setup_install_target)
     install(TARGETS draco DESTINATION
                     "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
   else()
-    install(TARGETS draco_static DESTINATION
+    target_include_directories(draco_static INTERFACE ${DRACO_INCLUDE_DIRS})
+    install(TARGETS draco_static EXPORT draco-targets DESTINATION
                     "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
     if(BUILD_SHARED_LIBS)
-      install(TARGETS draco_shared DESTINATION
+      target_include_directories(draco_shared INTERFACE ${DRACO_INCLUDE_DIRS})
+      install(TARGETS draco_shared EXPORT draco-targets DESTINATION
                       "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
     endif()
+    install(EXPORT draco-targets NAMESPACE draco:: DESTINATION
+                   "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/cmake/draco")
   endif()
 
   if(DRACO_UNITY_PLUGIN)