You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gentoo-overlay/dev-util/catkin/files/catkin_prefix_path.patch

56 lines
2.5 KiB

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)