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-python/catkin_pkg/files/catkin_prefix2.patch

31 lines
1.7 KiB

Allow CATKIN_PREFIX_PATH to work as CMAKE_PREFIX_PATH:
When building with SYSROOT!=/, CMAKE_PREFIX_PATH is the same as with SYSROOT=/
but we need to find packages in SYSROOT.
Index: catkin_pkg-0.4.22/src/catkin_pkg/workspaces.py
===================================================================
--- catkin_pkg-0.4.22.orig/src/catkin_pkg/workspaces.py
+++ catkin_pkg-0.4.22/src/catkin_pkg/workspaces.py
@@ -41,16 +41,17 @@ CATKIN_WORKSPACE_MARKER_FILE = '.catkin_
def get_spaces(paths=None):
"""
- Return a list of spaces based on the CMAKE_PREFIX_PATH or passed in list of workspaces.
+ Return a list of spaces based on the CMAKE_PREFIX_PATH/CATKIN_PREFIX_PATH or passed in list of workspaces.
It resolves the source space for each devel space and ignores non-catkin paths.
:param paths_to_order: list of paths
:param prefix_paths: list of prefixes, must not end with '/'
"""
if paths is None:
- if 'CMAKE_PREFIX_PATH' not in os.environ:
- raise RuntimeError('Neither the environment variable CMAKE_PREFIX_PATH is set nor was a list of paths passed.')
- paths = os.environ['CMAKE_PREFIX_PATH'].split(os.pathsep) if os.environ['CMAKE_PREFIX_PATH'] else []
+ if 'CMAKE_PREFIX_PATH' not in os.environ and 'CATKIN_PREFIX_PATH' not in os.environ:
+ raise RuntimeError('None of the environment variables CMAKE_PREFIX_PATH or CATKIN_PREFIX_PATH are set nor was a list of paths passed.')
+ paths = os.environ['CMAKE_PREFIX_PATH'].split(os.pathsep) if os.environ.get('CMAKE_PREFIX_PATH') else []
+ paths += os.environ['CATKIN_PREFIX_PATH'].split(os.pathsep) if os.environ.get('CATKIN_PREFIX_PATH') else []
spaces = []
for path in paths: