diff --git a/bloom/generators/debian/generator.py b/bloom/generators/debian/generator.py index 6e1a9af3..4a85dc56 100644 --- a/bloom/generators/debian/generator.py +++ b/bloom/generators/debian/generator.py @@ -83,6 +83,8 @@ from bloom.packages import get_package_data +from bloom.rosdistro_api import get_distribution_type + from bloom.util import code from bloom.util import to_unicode from bloom.util import execute_command @@ -344,6 +346,9 @@ def generate_substitutions_from_package( data['Package'] = sanitize_package_name(package.name) # Installation prefix data['InstallationPrefix'] = installation_prefix + # ROS version + ros_distro_type = get_distribution_type(ros_distro) + data['RosVersion'] = int(ros_distro_type[3:]) # Resolve dependencies evaluate_package_conditions(package, ros_distro) depends = [ diff --git a/bloom/generators/debian/templates/catkin/rules.em b/bloom/generators/debian/templates/catkin/rules.em index 276329db..58e36a77 100755 --- a/bloom/generators/debian/templates/catkin/rules.em +++ b/bloom/generators/debian/templates/catkin/rules.em @@ -30,9 +30,12 @@ override_dh_auto_configure: # In case we're installing to a non-standard location, look for a setup.sh # in the install tree that was dropped by catkin, and source it. It will # set things like CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. + # Note that CMAKE_INSTALL_LIBDIR is set to lib/ by default, but + # only affects packages that use GNUInstallDirs. if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ dh_auto_configure -- \ -DCATKIN_BUILD_BINARY_PACKAGE="1" \ + -DCMAKE_INSTALL_LIBDIR="lib" \ -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \ -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \ $(BUILD_TESTING_ARG) diff --git a/bloom/generators/debian/templates/cmake/rules.em b/bloom/generators/debian/templates/cmake/rules.em index 284a0714..362e915b 100755 --- a/bloom/generators/debian/templates/cmake/rules.em +++ b/bloom/generators/debian/templates/cmake/rules.em @@ -33,9 +33,11 @@ override_dh_auto_configure: # In case we're installing to a non-standard location, look for a setup.sh # in the install tree and source it. It will set things like # CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. +@[if RosDistro == 1] # CMAKE_INSTALL_LIBDIR is set for packages that use GNUInstallDirs.@[end if] if [ -f "@(InstallationPrefix)/setup.sh" ]; then . "@(InstallationPrefix)/setup.sh"; fi && \ dh_auto_configure -- \ -DCMAKE_INSTALL_PREFIX="@(InstallationPrefix)" \ +@[if RosDistro == 1] -DCMAKE_INSTALL_LIBDIR="lib" \@[end if] -DCMAKE_PREFIX_PATH="@(InstallationPrefix)" \ $(BUILD_TESTING_ARG)