diff options
author | Alexis Ballier <aballier@gentoo.org> | 2017-03-02 10:01:03 +0100 |
---|---|---|
committer | Alexis Ballier <aballier@gentoo.org> | 2017-03-02 10:17:01 +0100 |
commit | dac4dc6e2039638265ec2c678fd01af3714640ad (patch) | |
tree | c4d0bdce45e4cd8bf00fc6cf55ed4974f08d5084 /eclass/ros-catkin.eclass | |
parent | dev-ros/rospack: remove old (diff) | |
download | gentoo-dac4dc6e2039638265ec2c678fd01af3714640ad.tar.gz gentoo-dac4dc6e2039638265ec2c678fd01af3714640ad.tar.bz2 gentoo-dac4dc6e2039638265ec2c678fd01af3714640ad.zip |
eclass/ros-catkin.eclass: Add CATKIN_IN_SOURCE_BUILD support.
Diffstat (limited to 'eclass/ros-catkin.eclass')
-rw-r--r-- | eclass/ros-catkin.eclass | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/eclass/ros-catkin.eclass b/eclass/ros-catkin.eclass index 3daee77b5636..b427e0861b82 100644 --- a/eclass/ros-catkin.eclass +++ b/eclass/ros-catkin.eclass @@ -32,6 +32,11 @@ EGIT_REPO_URI="${ROS_REPO_URI}" # Usually, a repository contains several packages, hence a typical value is: # ROS_SUBDIR=${PN} +# @ECLASS-VARIABLE: CATKIN_IN_SOURCE_BUILD +# @DEFAULT_UNSET +# @DESCRIPTION: +# Set to enable in-source build. + SCM="" if [ "${PV#9999}" != "${PV}" ] ; then SCM="git-r3" @@ -140,12 +145,18 @@ HOMEPAGE="http://wiki.ros.org/${PN}" # Calls cmake-utils_src_prepare (so that PATCHES array is handled there) and initialises the workspace # by installing a recursive CMakeLists.txt to handle bundles. ros-catkin_src_prepare() { + # If no multibuild, just use cmake IN_SOURCE support + [ -n "${CATKIN_IN_SOURCE_BUILD}" ] && [ -z "${CATKIN_DO_PYTHON_MULTIBUILD}" ] && export CMAKE_IN_SOURCE_BUILD=yes + cmake-utils_src_prepare if [ ! -f "${S}/CMakeLists.txt" ] ; then catkin_init_workspace || die fi + # If python multibuild, copy the sources + [ -n "${CATKIN_IN_SOURCE_BUILD}" ] && [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] && python_copy_sources + # Most packages require C++11 these days. Do it here, in src_prepare so that # ebuilds can override it in src_configure. append-cxxflags '-std=c++11' @@ -163,6 +174,9 @@ ros-catkin_src_configure_internal() { -DPYTHON_INSTALL_DIR="${sitedir#${EPREFIX}/usr/}" ) python_export PYTHON_SCRIPTDIR + if [ -n "${CATKIN_IN_SOURCE_BUILD}" ] ; then + export CMAKE_USE_DIR="${BUILD_DIR}" + fi fi cmake-utils_src_configure "${@}" } @@ -206,6 +220,9 @@ ros-catkin_src_configure() { # Builds a catkin-based package. ros-catkin_src_compile() { if [ -n "${CATKIN_DO_PYTHON_MULTIBUILD}" ] ; then + if [ -n "${CATKIN_IN_SOURCE_BUILD}" ] ; then + export CMAKE_USE_DIR="${BUILD_DIR}" + fi python_foreach_impl cmake-utils_src_compile "${@}" else cmake-utils_src_compile "${@}" @@ -246,6 +263,9 @@ ros-catkin_src_test() { # Decorator around cmake-utils_src_install to ensure python scripts are properly handled w.r.t. python-exec2. ros-catkin_src_install_with_python() { python_export PYTHON_SCRIPTDIR + if [ -n "${CATKIN_IN_SOURCE_BUILD}" ] ; then + export CMAKE_USE_DIR="${BUILD_DIR}" + fi cmake-utils_src_install "${@}" if [ ! -f "${T}/.catkin_python_symlinks_generated" -a -d "${D}/${PYTHON_SCRIPTDIR}" ]; then dodir /usr/bin |