diff --git a/CMakeLists.txt b/CMakeLists.txt index 075da10a..7043c066 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,8 +9,9 @@ catkin_stack() # add_gtest(), which is called from within lower-level CMakeLists.txts. catkin_python_setup() +catkin_add_env_hooks(10.ros SHELLS bat sh DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/env-hooks) + foreach(subdir - env-hooks tools/rosunit core/roslib tools/rosbash @@ -21,7 +22,7 @@ endforeach() # nosetests are declared here to make them visible to the build system # (e.g., for Jenkins to invoke) but keep them from polluting the pristine # Python packages. -find_package(ROS COMPONENTS rosunit) +find_package(catkin COMPONENTS rosunit) add_nosetests(core/roslib/test) add_nosetests(tools/rosmake/test) add_nosetests(tools/rosunit/test) diff --git a/core/rosbuild/rosbuild.cmake b/core/rosbuild/rosbuild.cmake index 10629a55..1df72cff 100644 --- a/core/rosbuild/rosbuild.cmake +++ b/core/rosbuild/rosbuild.cmake @@ -4,25 +4,25 @@ cmake_minimum_required(VERSION 2.4.6) # # Catkin-compat thunks # -cmake_policy(SET CMP0011 OLD) +#cmake_policy(SET CMP0011 OLD) macro(rosbuild_catkinize) endmacro() # Policy settings to prevent warnings on 2.6 but ensure proper operation on # 2.4. -if(COMMAND cmake_policy) +#if(COMMAND cmake_policy) # Logical target names must be globally unique. - cmake_policy(SET CMP0002 OLD) +# cmake_policy(SET CMP0002 OLD) # Libraries linked via full path no longer produce linker search paths. - cmake_policy(SET CMP0003 OLD) +# cmake_policy(SET CMP0003 OLD) # Preprocessor definition values are now escaped automatically. - cmake_policy(SET CMP0005 OLD) - if(POLICY CMP0011) +# cmake_policy(SET CMP0005 OLD) +# if(POLICY CMP0011) # Included scripts do automatic cmake_policy PUSH and POP. - cmake_policy(SET CMP0011 OLD) - endif(POLICY CMP0011) -endif(COMMAND cmake_policy) +# cmake_policy(SET CMP0011 OLD) +# endif(POLICY CMP0011) +#endif(COMMAND cmake_policy) set(CMAKE_OSX_ARCHITECTURES "x86_64") diff --git a/core/roslib/CMakeLists.txt b/core/roslib/CMakeLists.txt index 3bd0954a..a7bbdeb9 100644 --- a/core/roslib/CMakeLists.txt +++ b/core/roslib/CMakeLists.txt @@ -1,8 +1,7 @@ project(roslib) -find_package(catkin REQUIRED) -find_package(ROS REQUIRED COMPONENTS rospack rosunit) +find_package(catkin REQUIRED COMPONENTS rospack rosunit) -include_directories(include ${Boost_INCLUDE_DIRS} ${ROS_INCLUDE_DIRS}) +include_directories(include ${Boost_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}) # Avoid a boost warning that pops up when using msvc compiler if(MSVC) @@ -10,7 +9,7 @@ if(MSVC) endif() add_library(roslib src/package.cpp) -target_link_libraries(roslib ${Boost_LIBRARIES} ${ROS_LIBRARIES}) +target_link_libraries(roslib ${Boost_LIBRARIES} ${catkin_LIBRARIES}) if(NOT (APPLE OR WIN32 OR MINGW)) target_link_libraries(roslib rt) @@ -38,7 +37,11 @@ catkin_project(roslib #integration tests add_gtest(${PROJECT_NAME}-utest test/utest.cpp) -target_link_libraries(${PROJECT_NAME}-utest roslib ${Boost_LIBRARIES} ${ROS_LIBRARIES}) +if(TARGET ${PROJECT_NAME}-utest) + target_link_libraries(${PROJECT_NAME}-utest roslib ${Boost_LIBRARIES} ${catkin_LIBRARIES}) +endif() add_gtest(${PROJECT_NAME}-test_package test/package.cpp) -target_link_libraries(${PROJECT_NAME}-test_package roslib ${ROS_LIBRARIES}) +if(TARGET ${PROJECT_NAME}-test_package) + target_link_libraries(${PROJECT_NAME}-test_package roslib ${catkin_LIBRARIES}) +endif() diff --git a/core/roslib/src/roslib/packages.py b/core/roslib/src/roslib/packages.py index 50c1a000..225d0260 100644 --- a/core/roslib/src/roslib/packages.py +++ b/core/roslib/src/roslib/packages.py @@ -46,6 +46,7 @@ import string from subprocess import Popen, PIPE +from catkin.find_in_workspaces import find_in_workspaces as catkin_find import rospkg import roslib.manifest @@ -384,7 +385,7 @@ def list_pkgs_by_path(path, packages=None, cache=None, env=None): return packages -def find_node(pkg, node_type, rospack=None, catkin_packages_cache=None): +def find_node(pkg, node_type, rospack=None): """ Warning: unstable API due to catkin. @@ -397,40 +398,12 @@ def find_node(pkg, node_type, rospack=None, catkin_packages_cache=None): if rospack is None: rospack = rospkg.RosPack() - return find_resource(pkg, node_type, filter_fn=_executable_filter, - rospack=rospack, catkin_packages_cache=catkin_packages_cache) + return find_resource(pkg, node_type, filter_fn=_executable_filter, rospack=rospack) def _executable_filter(test_path): s = os.stat(test_path) return (s.st_mode & (stat.S_IRUSR | stat.S_IXUSR) == (stat.S_IRUSR | stat.S_IXUSR)) - -# TODO: this routine really belongs in catkin -def _load_catkin_packages_cache(catkin_packages_cache, env=None): - """ - env[CATKIN_BINARY_DIR] *must* be set - :param env: OS environment (defaults to os.environ if None/not set) - :param catkin_packages_cache: dictionary to read cache into. - Contents of dictionary will be replaced if cache is read. ``dict`` - - :raises: :exc:`KeyError` if env[CATKIN_BINARY_DIR] is not set - """ - if env is None: - env=os.environ - prefix = env[CATKIN_BINARY_DIR] - cache_file = os.path.join(prefix, 'etc', 'packages.list') - if os.path.isfile(cache_file): - catkin_packages_cache.clear() - with open(cache_file, 'r') as f: - for l in f.readlines(): - l = l.strip() - # Example: - # rosconsole ros_comm/tools/rosconsole\n - if not l: - continue - idx = l.find(' ') - catkin_packages_cache[l[:idx]] = os.path.join(prefix, l[idx+1:]) - def _find_resource(d, resource_name, filter_fn=None): """ subroutine of find_resource @@ -485,7 +458,7 @@ def _find_resource(d, resource_name, filter_fn=None): # TODO: this routine really belongs in rospkg, but the catkin-isms really, really don't # belong in rospkg. With more thought, they can probably be abstracted out so as # to no longer be catkin-specific. -def find_resource(pkg, resource_name, filter_fn=None, rospack=None, catkin_packages_cache=None): +def find_resource(pkg, resource_name, filter_fn=None, rospack=None): """ Warning: unstable API due to catkin. @@ -499,7 +472,6 @@ def find_resource(pkg, resource_name, filter_fn=None, rospack=None, catkin_packa :param filter: function that takes in a path argument and returns True if the it matches the desired resource, ``fn(str)`` :param rospack: `rospkg.RosPack` instance to use - :param catkin_packages_cache: dictionary for caching catkin packages.list :returns: lists of matching paths for resource within a given scope, ``[str]`` :raises: :exc:`rospkg.ResourceNotFound` If package does not exist """ @@ -515,21 +487,19 @@ def find_resource(pkg, resource_name, filter_fn=None, rospack=None, catkin_packa if rospack is None: rospack = rospkg.RosPack() - if catkin_packages_cache is None: - catkin_packages_cache = {} - + # lookup package as it *must* exist pkg_path = rospack.get_path(pkg) - - # load catkin packages list, if necessary - if CATKIN_BINARY_DIR in os.environ and not catkin_packages_cache: - _load_catkin_packages_cache(catkin_packages_cache) # if found in binary dir, start with that. in any case, use matches # from ros_package_path matches = [] - if pkg in catkin_packages_cache: - matches.extend(_find_resource(catkin_packages_cache[pkg], resource_name, filter_fn=filter_fn)) + for search_in in ['libexec', 'share']: + try: + search_path = catkin_find(pkg, search_in=[search_in]) + matches.extend(_find_resource(search_path, resource_name, filter_fn=filter_fn)) + except RuntimeError: + pass matches.extend(_find_resource(pkg_path, resource_name, filter_fn=filter_fn)) # Uniquify the results, in case we found the same file twice return list(set(matches)) diff --git a/core/roslib/src/roslib/rosenv.py b/core/roslib/src/roslib/rosenv.py index 1a29d66c..87d15d23 100644 --- a/core/roslib/src/roslib/rosenv.py +++ b/core/roslib/src/roslib/rosenv.py @@ -60,7 +60,7 @@ ROS_NAMESPACE ="ROS_NAMESPACE" ## directory in which log files are written ROS_LOG_DIR ="ROS_LOG_DIR" ## directory in which test result files are written -ROS_TEST_RESULTS_DIR = "ROS_TEST_RESULTS_DIR" +CATKIN_TEST_RESULTS_DIR = "CATKIN_TEST_RESULTS_DIR" class ROSEnvException(Exception): """Base class of roslib.rosenv errors.""" @@ -189,9 +189,9 @@ def get_log_dir(env=None): def get_test_results_dir(env=None): """ Get directory to use for writing test result files. There are multiple - possible locations for this. The ROS_TEST_RESULTS_DIR environment variable - has priority. If that is set, ROS_TEST_RESULTS_DIR is returned. - If ROS_TEST_RESULTS_DIR is not set, then ROS_HOME/test_results is used. If + possible locations for this. The CATKIN_TEST_RESULTS_DIR environment variable + has priority. If that is set, CATKIN_TEST_RESULTS_DIR is returned. + If CATKIN_TEST_RESULTS_DIR is not set, then ROS_HOME/test_results is used. If ROS_HOME is not set, $HOME/.ros/test_results is used. @param env: environment dictionary (defaults to os.environ) @@ -202,8 +202,8 @@ def get_test_results_dir(env=None): if env is None: env = os.environ - if ROS_TEST_RESULTS_DIR in env: - return env[ROS_TEST_RESULTS_DIR] + if CATKIN_TEST_RESULTS_DIR in env: + return env[CATKIN_TEST_RESULTS_DIR] else: return os.path.join(get_ros_home(env), 'test_results') diff --git a/env-hooks/10.ros.all.in b/env-hooks/10.ros.all.in deleted file mode 100644 index 4c72a258..00000000 --- a/env-hooks/10.ros.all.in +++ /dev/null @@ -1,15 +0,0 @@ -# -# Installed ROS env file -# This file was automatically generated. -# - -# Scrub old ROS bin dirs, to avoid accidentally finding the wrong executables -PATH=`python -c "import os; print(os.pathsep.join([x for x in \"$PATH\".split(os.pathsep) if not any([d for d in ['cturtle', 'diamondback', 'electric', 'unstable'] if d in x])]))"` - -export ROS_ROOT=@CMAKE_INSTALL_PREFIX@/share/ros -export ROS_PACKAGE_PATH=@CMAKE_INSTALL_PREFIX@/share:@CMAKE_INSTALL_PREFIX@/stacks -if [ ! "$ROS_MASTER_URI" ] ; then - export ROS_MASTER_URI=http://localhost:11311 -fi -export ROS_ETC_DIR=@CMAKE_INSTALL_PREFIX@/etc/ros -export ROS_DISTRO=fuerte diff --git a/env-hooks/10.ros.bat.in b/env-hooks/10.ros.bat.in new file mode 100644 index 00000000..3acb3d61 --- /dev/null +++ b/env-hooks/10.ros.bat.in @@ -0,0 +1,20 @@ +REM generated from ros/env-hooks/10.ros.bat.in + +REM scrub old ROS bin dirs, to avoid accidentally finding the wrong executables +PATH=`python -c "import os; print(os.pathsep.join([x for x in \"$PATH\".split(os.pathsep) if not any([d for d in ['cturtle', 'diamondback', 'electric', 'fuerte'] if d in x])]))"` + +export ROS_DISTRO=groovy +if "%ROS_MASTER_URI%" EQ "" ( + export ROS_MASTER_URI=http://localhost:11311 +) + +if @ENV_BUILDSPACE@ ( + export ROS_PACKAGE_PATH=@CMAKE_SOURCE_DIR@ + export ROS_ROOT=@CMAKE_CURRENT_SOURCE_DIR@ + export ROS_ETC_DIR=@catkin_BUILD_PREFIX@/etc/ros +) +if @ENV_INSTALLSPACE@ ( + export ROS_PACKAGE_PATH=@CMAKE_INSTALL_PREFIX@/share:@CMAKE_INSTALL_PREFIX@/stacks + export ROS_ROOT=@CMAKE_INSTALL_PREFIX@/share/ros + export ROS_ETC_DIR=@CMAKE_INSTALL_PREFIX@/etc/ros +) diff --git a/env-hooks/10.ros.buildspace.all.in b/env-hooks/10.ros.buildspace.all.in deleted file mode 100644 index 420b3e8b..00000000 --- a/env-hooks/10.ros.buildspace.all.in +++ /dev/null @@ -1,16 +0,0 @@ -# -# Buildspace ROS env file. -# This file was automatically generated. -# - -# Scrub old ROS bin dirs, to avoid accidentally finding the wrong executables -PATH=`python -c "import os; print(os.pathsep.join([x for x in \"$PATH\".split(os.pathsep) if not any([d for d in ['cturtle', 'diamondback', 'electric', 'unstable'] if d in x])]))"` - -#No ROS_ROOT in buildspace, ROS_ROOT is only for legacy (dry) builds -export ROS_TEST_RESULTS_DIR=@CMAKE_BINARY_DIR@/test_results -export ROS_PACKAGE_PATH=@CMAKE_SOURCE_DIR@ -export ROS_DISTRO=fuerte -export PATH=@CMAKE_SOURCE_DIR@/ros/bin:$PATH -if [ ! "$ROS_MASTER_URI" ] ; then - export ROS_MASTER_URI=http://localhost:11311 -fi diff --git a/env-hooks/10.ros.sh.in b/env-hooks/10.ros.sh.in new file mode 100644 index 00000000..29b42822 --- /dev/null +++ b/env-hooks/10.ros.sh.in @@ -0,0 +1,20 @@ +# generated from ros/env-hooks/10.ros.sh.in + +# scrub old ROS bin dirs, to avoid accidentally finding the wrong executables +PATH=`python -c "import os; print(os.pathsep.join([x for x in \"$PATH\".split(os.pathsep) if not any([d for d in ['cturtle', 'diamondback', 'electric', 'fuerte'] if d in x])]))"` + +export ROS_DISTRO=groovy +if [ ! "$ROS_MASTER_URI" ] ; then + export ROS_MASTER_URI=http://localhost:11311 +fi + +if @ENV_BUILDSPACE@; then + export ROS_PACKAGE_PATH=@CMAKE_SOURCE_DIR@ + export ROS_ROOT=@CMAKE_CURRENT_SOURCE_DIR@ + export ROS_ETC_DIR=@catkin_BUILD_PREFIX@/etc/ros +fi +if @ENV_INSTALLSPACE@; then + export ROS_PACKAGE_PATH=@CMAKE_INSTALL_PREFIX@/share:@CMAKE_INSTALL_PREFIX@/stacks + export ROS_ROOT=@CMAKE_INSTALL_PREFIX@/share/ros + export ROS_ETC_DIR=@CMAKE_INSTALL_PREFIX@/etc/ros +fi diff --git a/env-hooks/CMakeLists.txt b/env-hooks/CMakeLists.txt deleted file mode 100644 index 83a17a97..00000000 --- a/env-hooks/CMakeLists.txt +++ /dev/null @@ -1,3 +0,0 @@ -catkin_add_env_hooks(10.ros - SHELLS all - ) diff --git a/tools/rosbash/15.rosbash.bash.in b/tools/rosbash/15.rosbash.bash.in index 9968d1a0..ff143046 100644 --- a/tools/rosbash/15.rosbash.bash.in +++ b/tools/rosbash/15.rosbash.bash.in @@ -1,2 +1,6 @@ -. @CMAKE_INSTALL_PREFIX@/share/rosbash/rosbash - +if @ENV_BUILDSPACE@; then + . @CMAKE_CURRENT_SOURCE_DIR@/rosbash +fi +if @ENV_INSTALLSPACE@; then + . @CMAKE_INSTALL_PREFIX@/share/rosbash/rosbash +fi diff --git a/tools/rosbash/15.rosbash.buildspace.bash.in b/tools/rosbash/15.rosbash.buildspace.bash.in deleted file mode 100644 index 3909123a..00000000 --- a/tools/rosbash/15.rosbash.buildspace.bash.in +++ /dev/null @@ -1,2 +0,0 @@ -. @CMAKE_CURRENT_SOURCE_DIR@/rosbash - diff --git a/tools/rosbash/15.rosbash.buildspace.zsh.in b/tools/rosbash/15.rosbash.buildspace.zsh.in deleted file mode 100644 index cf0c52cb..00000000 --- a/tools/rosbash/15.rosbash.buildspace.zsh.in +++ /dev/null @@ -1,2 +0,0 @@ -. @CMAKE_CURRENT_SOURCE_DIR@/roszsh - diff --git a/tools/rosbash/15.rosbash.tcsh.in b/tools/rosbash/15.rosbash.tcsh.in new file mode 100644 index 00000000..af1ef479 --- /dev/null +++ b/tools/rosbash/15.rosbash.tcsh.in @@ -0,0 +1,6 @@ +if @ENV_BUILDSPACE@; then + . @CMAKE_CURRENT_SOURCE_DIR@/rostcsh +fi +if @ENV_INSTALLSPACE@; then + . @CMAKE_INSTALL_PREFIX@/share/rosbash/rostcsh +fi diff --git a/tools/rosbash/15.rosbash.zsh.in b/tools/rosbash/15.rosbash.zsh.in index ad2c130b..d0677034 100644 --- a/tools/rosbash/15.rosbash.zsh.in +++ b/tools/rosbash/15.rosbash.zsh.in @@ -1,2 +1,6 @@ -. @CMAKE_INSTALL_PREFIX@/share/rosbash/roszsh - +if @ENV_BUILDSPACE@; then + . @CMAKE_CURRENT_SOURCE_DIR@/roszsh +fi +if @ENV_INSTALLSPACE@; then + . @CMAKE_INSTALL_PREFIX@/share/rosbash/roszsh +fi diff --git a/tools/rosbash/CMakeLists.txt b/tools/rosbash/CMakeLists.txt index e1c3f804..5611e3d9 100644 --- a/tools/rosbash/CMakeLists.txt +++ b/tools/rosbash/CMakeLists.txt @@ -8,9 +8,7 @@ install(PROGRAMS scripts/rosrun message(STATUS " Making toplevel forward script for bash script rosrun") set(BASH_SCRIPT ${CMAKE_CURRENT_SOURCE_DIR}/scripts/rosrun) configure_file(${catkin_EXTRAS_DIR}/templates/script.bash.in - ${CMAKE_BINARY_DIR}/bin/rosrun + ${catkin_BUILD_PREFIX}/bin/rosrun @ONLY) -catkin_add_env_hooks(15.rosbash - SHELLS bash zsh - ) +catkin_add_env_hooks(15.rosbash SHELLS bash tcsh zsh) diff --git a/tools/rosbash/rosbash b/tools/rosbash/rosbash index 64b28170..98c3bb09 100644 --- a/tools/rosbash/rosbash +++ b/tools/rosbash/rosbash @@ -219,22 +219,16 @@ function rosls { # sets arg as return value function _roscmd { - local pkgdir exepath opt catkin_source_dir catkin_binary_dir opts - if [[ -n $CATKIN_SOURCE_DIR ]]; then - catkin_source_dir=`ROS_ROOT=$CATKIN_SOURCE_DIR ROS_PACKAGE_PATH= _ros_package_find $1` - fi - if [[ -n $CATKIN_BINARY_DIR && -f $CATKIN_BINARY_DIR/etc/packages.list ]]; then - cbd=`grep $1 $CATKIN_BINARY_DIR/etc/packages.list | cut -d " " -f 2` - if [[ -n $cbd ]]; then - catkin_binary_dir=$CATKIN_BINARY_DIR/$cbd - fi - fi + local pkgdir exepath opt catkin_project_libexec_dir opts + if [[ -n $CATKIN_WORKSPACES ]]; then + catkin_project_libexec_dir=`catkin-find $1 --libexec 2> /dev/null` + fi pkgdir=`_ros_package_find $1` - if [[ -z $catkin_source_dir && -z $catkin_binary_dir && -z $pkgdir ]]; then + if [[ -z $catkin_project_libexec_dir && -z $pkgdir ]]; then echo "Couldn't find package [$1]" return 1 fi - exepath=(`find -L $catkin_source_dir $catkin_binary_dir $pkgdir -name $2 -type f ! -regex .*/[.].* ! -regex .*$pkgdir\/build\/.* | uniq`) + exepath=(`find -L $catkin_project_libexec_dir $pkgdir -name $2 -type f ! -regex .*/[.].* ! -regex .*$pkgdir\/build\/.* | uniq`) if [[ ${#exepath[@]} == 0 ]] ; then echo "That file does not exist in that package." return 1 @@ -423,18 +417,12 @@ function _roscomplete_search_dir { COMPREPLY=($(compgen -W "${opts}" -- ${arg})) unset IFS elif [[ $COMP_CWORD == 2 ]]; then - if [[ -n "$CATKIN_SOURCE_DIR" ]]; then - catkin_source_dir=`ROS_ROOT=$CATKIN_SOURCE_DIR ROS_PACKAGE_PATH= _ros_package_find ${COMP_WORDS[1]}` - fi - if [[ -n $CATKIN_BINARY_DIR && -f $CATKIN_BINARY_DIR/etc/packages.list ]]; then - cbd=`grep ${COMP_WORDS[1]} $CATKIN_BINARY_DIR/etc/packages.list | cut -d " " -f 2` - if [[ -n $cbd ]]; then - catkin_binary_dir=$CATKIN_BINARY_DIR/$cbd - fi - fi + if [[ -n $CATKIN_WORKSPACES ]]; then + catkin_project_libexec_dir=`catkin-find ${COMP_WORDS[1]} --libexec 2> /dev/null` + fi pkgdir=`_ros_package_find ${COMP_WORDS[1]}` - if [[ -n "$catkin_source_dir" || -n "$catkin_binary_dir" || -n "$pkgdir" ]]; then - opts=`_rosfind -L $catkin_source_dir $catkin_binary_dir $pkgdir ${1} ! -regex ".*/[.].*" ! -regex ".*$pkgdir\/build\/.*" -print0 | tr '\000' '\n' | sed -e "s/.*\/\(.*\)/\1/g"` + if [[ -n "$catkin_project_libexec_dir_dir" || -n "$pkgdir" ]]; then + opts=`_rosfind -L $catkin_project_libexec_dir $pkgdir ${1} ! -regex ".*/[.].*" ! -regex ".*$pkgdir\/build\/.*" -print0 | tr '\000' '\n' | sed -e "s/.*\/\(.*\)/\1/g"` else opts="" fi diff --git a/tools/rosbash/scripts/rosrun b/tools/rosbash/scripts/rosrun index 60f21625..60a0552f 100755 --- a/tools/rosbash/scripts/rosrun +++ b/tools/rosbash/scripts/rosrun @@ -21,24 +21,18 @@ case $2 in esac # basename also makes .//foo into foo basename=`basename $2` -if [[ -n $CATKIN_SOURCE_DIR ]]; then - catkin_source_dir=`ROS_ROOT=$CATKIN_SOURCE_DIR ROS_PACKAGE_PATH= rospack find $1` -fi -if [[ -n $CATKIN_BINARY_DIR && -f $CATKIN_BINARY_DIR/etc/packages.list ]]; then - cbd=`grep $1 $CATKIN_BINARY_DIR/etc/packages.list | cut -d " " -f 2` - if [[ -n $cbd ]]; then - catkin_binary_dir=$CATKIN_BINARY_DIR/$cbd - fi -fi +if [[ -n $CATKIN_WORKSPACES ]]; then + catkin_project_libexec_dir=`catkin-find $1 --libexec 2> /dev/null` +fi pkgdir=`rospack find $1` -if [[ -z $catkin_source_dir && -z $catkin_binary_dir && -z $pkgdir ]]; then +if [[ -z $catkin_project_libexec_dir && -z $pkgdir ]]; then exit 2 fi if [[ ! $2 == */* ]]; then # The -perm /mode usage is not available in find on the Mac #exepathlist=(`find $pkgdir -name $2 -type f -perm /u+x,g+x,o+x`) # -L: #3475 - exepathlist=(`find -L $catkin_source_dir $catkin_binary_dir $pkgdir -name $2 -type f -perm +111 ! -regex ".*$pkgdir\/build\/.*" | uniq`) + exepathlist=(`find -L $catkin_project_libexec_dir $pkgdir -name $2 -type f -perm +111 ! -regex ".*$pkgdir\/build\/.*" | uniq`) if [[ ${#exepathlist[@]} == 0 ]] ; then echo "[rosrun] Couldn't find executable named $2 below $pkgdir" nonexepathlist=(`find -H $pkgdir -name $2`) diff --git a/tools/rosunit/cmake/rosunit-extras.cmake.in b/tools/rosunit/cmake/rosunit-extras.cmake.in index b9abdebb..df4b056e 100644 --- a/tools/rosunit/cmake/rosunit-extras.cmake.in +++ b/tools/rosunit/cmake/rosunit-extras.cmake.in @@ -1,5 +1,5 @@ macro(rosunit_initialize_tests) - if(rosunit_SOURCE_DIR) + if (@PKG_BUILDSPACE@) find_program_required(ROSUNIT_EXE rosunit PATHS @PROJECT_SOURCE_DIR@/scripts NO_DEFAULT_PATH)