Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help find catkin python for install underlays #406

Merged
merged 1 commit into from
May 1, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions cmake/templates/generate_cached_setup.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,19 @@ import os
import stat
import sys

# find the import relatively if available to work before installing catkin or overlaying installed version
# find the import for catkin's python package - either from source space or from an installed underlay
if os.path.exists(os.path.join('@catkin_EXTRAS_DIR@', 'catkinConfig.cmake.in')):
sys.path.insert(0, os.path.join('@catkin_EXTRAS_DIR@', '..', 'python'))
from catkin.environment_cache import generate_environment_script
try:
from catkin.environment_cache import generate_environment_script
except ImportError:
# search for catkin package in all workspaces and prepend to path
for workspace in "@CATKIN_WORKSPACES@".split(';'):
python_path = os.path.join(workspace, '@CATKIN_GLOBAL_PYTHON_DESTINATION@')
if os.path.isdir(os.path.join(python_path, 'catkin')):
sys.path.insert(0, python_path)
break
from catkin.environment_cache import generate_environment_script

code = generate_environment_script('@CATKIN_DEVEL_PREFIX@/env.@script_ext@')

Expand Down