diff options
Diffstat (limited to 'dev-util/catkin/files/catkin_prefix_path.patch')
-rw-r--r-- | dev-util/catkin/files/catkin_prefix_path.patch | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/dev-util/catkin/files/catkin_prefix_path.patch b/dev-util/catkin/files/catkin_prefix_path.patch new file mode 100644 index 000000000000..94e23ee0d98e --- /dev/null +++ b/dev-util/catkin/files/catkin_prefix_path.patch @@ -0,0 +1,55 @@ +Allow CATKIN_PREFIX_PATH to override/complement CMAKE_PREFIX_PATH. +This serves two goals: when SYSROOT!=/, CMAKE_PREFIX_PATH is the same as when +SYSROOT=/ but we need to find packages in SYSROOT/CMAKE_PREFIX_PATH. + +Moreover, this allows to set CATKIN_PREFIX_PATH in global environment so that +ROS packages are properly configured without needed to source a shellrc file in +every shell session. This can't be done with CMAKE_PREFIX_PATH which is way too +generic. + +Index: catkin-0.6.9/cmake/all.cmake +=================================================================== +--- catkin-0.6.9.orig/cmake/all.cmake ++++ catkin-0.6.9/cmake/all.cmake +@@ -52,7 +52,11 @@ set(CMAKE_PREFIX_PATH_AS_IS ${CMAKE_PREF + + # list of unique catkin workspaces based on CMAKE_PREFIX_PATH + set(CATKIN_WORKSPACES "") +-foreach(path ${CMAKE_PREFIX_PATH}) ++if(NOT DEFINED CATKIN_PREFIX_PATH) ++ set(CATKIN_PREFIX_PATH ${CMAKE_PREFIX_PATH}) ++endif() ++ ++foreach(path ${CATKIN_PREFIX_PATH}) + if(EXISTS "${path}/.catkin") + list(FIND CATKIN_WORKSPACES ${path} _index) + if(_index EQUAL -1) +Index: catkin-0.6.11/python/catkin/workspace.py +=================================================================== +--- catkin-0.6.11.orig/python/catkin/workspace.py ++++ catkin-0.6.11/python/catkin/workspace.py +@@ -44,7 +44,7 @@ def get_workspaces(): + """ + # get all cmake prefix paths + env_name = 'CMAKE_PREFIX_PATH' +- paths = [path for path in os.environ.get(env_name, '').split(os.pathsep) if path] ++ paths = [path for path in os.environ.get(env_name, '').split(os.pathsep) + os.environ.get('CATKIN_PREFIX_PATH', '').split(os.pathsep) if path] + # remove non-workspace paths + workspaces = [path for path in paths if os.path.isfile(os.path.join(path, CATKIN_MARKER_FILE))] + return workspaces +Index: catkin-0.6.9/cmake/catkinConfig.cmake.in +=================================================================== +--- catkin-0.6.9.orig/cmake/catkinConfig.cmake.in ++++ catkin-0.6.9/cmake/catkinConfig.cmake.in +@@ -64,6 +64,11 @@ if(catkin_FIND_COMPONENTS) + + # get search paths from CMAKE_PREFIX_PATH (which includes devel space) + set(paths "") ++ foreach(path ${CATKIN_PREFIX_PATH}) ++ if(IS_DIRECTORY ${path}/share/${component}/cmake) ++ list(APPEND paths ${path}/share/${component}/cmake) ++ endif() ++ endforeach() + foreach(path ${CMAKE_PREFIX_PATH}) + if(IS_DIRECTORY ${path}/share/${component}/cmake) + list(APPEND paths ${path}/share/${component}/cmake) |