Skip to content

Commit

Permalink
[Windows][kinetic] Fix devel and install space intermixes in %PATH% a…
Browse files Browse the repository at this point in the history
…fter devel\setup.bat is sourced (#1010)

* move the lib folder addition into _setup_util.py.in.

* Updated comments.
  • Loading branch information
seanyen authored and dirk-thomas committed May 31, 2019
1 parent 94c7d2e commit 9702882
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 7 additions & 1 deletion cmake/templates/_setup_util.py.in
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,17 @@ system = platform.system()
IS_DARWIN = (system == 'Darwin')
IS_WINDOWS = (system == 'Windows')

PATH_TO_ADD_SUFFIX = ['@CATKIN_GLOBAL_BIN_DESTINATION@']
if IS_WINDOWS:
# while catkin recommends putting dll's into bin, 3rd party packages often put dll's into lib
# since Windows finds dll's via the PATH variable, prepend it with path to lib
PATH_TO_ADD_SUFFIX.extend([@CATKIN_LIB_ENVIRONMENT_PATHS@])

# subfolder of workspace prepended to CMAKE_PREFIX_PATH
ENV_VAR_SUBFOLDERS = {
'CMAKE_PREFIX_PATH': '',
'LD_LIBRARY_PATH' if not IS_DARWIN else 'DYLD_LIBRARY_PATH': @CATKIN_LIB_ENVIRONMENT_PATHS@,
'PATH': '@CATKIN_GLOBAL_BIN_DESTINATION@',
'PATH': PATH_TO_ADD_SUFFIX,
'PKG_CONFIG_PATH': @CATKIN_PKGCONFIG_ENVIRONMENT_PATHS@,
'PYTHONPATH': '@PYTHON_INSTALL_DIR@',
}
Expand Down
4 changes: 0 additions & 4 deletions cmake/templates/setup.bat.in
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,6 @@ if %_HOOK_COUNT% LSS %_CATKIN_ENVIRONMENT_HOOKS_COUNT% (
goto :hook_loop
)

REM 3rdparty packages often put dll's into lib (convention is bin) and
REM windows finds it's dll's via the PATH variable. Make that happen here!
set PATH=%LD_LIBRARY_PATH%;%PATH%

REM unset temporary variables
set _SETUP_UTIL=
set _PYTHON=
Expand Down

0 comments on commit 9702882

Please sign in to comment.