File: 0001-Add-default-plugin-path.patch

package info (click to toggle)
ros-pluginlib 1.13.0-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 300 kB
  • sloc: cpp: 1,063; xml: 53; python: 33; makefile: 3
file content (63 lines) | stat: -rw-r--r-- 2,571 bytes parent folder | 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Mon, 30 Nov 2015 18:45:18 +0100
Subject: Add default plugin path

---
 pluginlib/CMakeLists.txt                         | 10 ++++++++++
 pluginlib/config.h.in                            |  1 +
 pluginlib/include/pluginlib/class_loader_imp.hpp |  2 ++
 3 files changed, 13 insertions(+)
 create mode 100644 pluginlib/config.h.in

diff --git a/pluginlib/CMakeLists.txt b/pluginlib/CMakeLists.txt
index 289c5af..0a22651 100644
--- a/pluginlib/CMakeLists.txt
+++ b/pluginlib/CMakeLists.txt
@@ -5,6 +5,13 @@ find_package(catkin REQUIRED COMPONENTS class_loader rosconsole roslib cmake_mod
 find_package(Boost REQUIRED COMPONENTS filesystem)
 find_package(TinyXML2 REQUIRED)
 
+set(PLUGINLIB_ARCH_TRIPLET "")
+if(CMAKE_INSTALL_PREFIX STREQUAL "/usr")
+  set(PLUGINLIB_ARCH_TRIPLET "/${CMAKE_LIBRARY_ARCHITECTURE}")
+endif()
+configure_file(config.h.in pluginlib/config.h @ONLY)
+include_directories(${CMAKE_CURRENT_BINARY_DIR})
+
 catkin_package(
   INCLUDE_DIRS include
   CATKIN_DEPENDS class_loader rosconsole roslib
@@ -41,3 +48,6 @@ install(DIRECTORY include/pluginlib/
 
 install(PROGRAMS scripts/pluginlib_headers_migration.py
   DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})
+
+install(FILES  ${CMAKE_BINARY_DIR}/pluginlib/config.h
+  DESTINATION ${CATKIN_GLOBAL_INCLUDE_DESTINATION}${PLUGINLIB_ARCH_TRIPLET}/${PROJECT_NAME})
diff --git a/pluginlib/config.h.in b/pluginlib/config.h.in
new file mode 100644
index 0000000..650f410
--- /dev/null
+++ b/pluginlib/config.h.in
@@ -0,0 +1 @@
+#define PLUGINLIB_ARCH_TRIPLET "@PLUGINLIB_ARCH_TRIPLET@"
diff --git a/pluginlib/include/pluginlib/class_loader_imp.hpp b/pluginlib/include/pluginlib/class_loader_imp.hpp
index d45b591..bfd673c 100644
--- a/pluginlib/include/pluginlib/class_loader_imp.hpp
+++ b/pluginlib/include/pluginlib/class_loader_imp.hpp
@@ -56,6 +56,7 @@
 #include "ros/package.h"
 
 #include "./class_loader.hpp"
+#include "pluginlib/config.h"
 
 #ifdef _WIN32
 const std::string os_pathsep(";");  // NOLINT
@@ -346,6 +347,7 @@ std::vector<std::string> ClassLoader<T>::getAllLibraryPathsToTry(
   std::vector<std::string> all_paths;
   std::vector<std::string> all_paths_without_extension = getCatkinLibraryPaths();
   all_paths_without_extension.push_back(getROSBuildLibraryPath(exporting_package_name));
+  all_paths_without_extension.push_back("/usr/lib" PLUGINLIB_ARCH_TRIPLET "/ros");
   bool debug_library_suffix = (0 == class_loader::systemLibrarySuffix().compare(0, 1, "d"));
   std::string non_debug_suffix;
   if (debug_library_suffix) {