CMake can't find yaml-cpp on debian jessie
I'm trying to release a new package on the ROS build farm, and the debian jessie build is currently failing due to the yaml-cpp
dependency. I have it listed as a dependency in my package.xml:
<depend>yaml-cpp</depend>
and the relevant lines in my CMakeLists.txt are:
find_package(yaml-cpp REQUIRED)
catkin_package(
...
DEPENDS YAML_CPP
)
include_directories(
${catkin_INCLUDE_DIRS}
${YAML_CPP_INCLUDE_DIR}
)
add_library(my_target ...)
target_link_libraries(my_target ${YAML_CPP_LIBRARIES})
On Ubuntu this builds just fine, both locally and on the ROS build farm. For the Debian Jessie build, however, I get the following error:
CMake Error at CMakeLists.txt:18 (find_package): By not providing "Findyaml-cpp.cmake" in CMAKE_MODULE_PATH this project has asked CMake to find a package configuration file provided by "yaml-cpp", but CMake did not find one. Could not find a package configuration file provided by "yaml-cpp" with any of the following names: yaml-cppConfig.cmake yaml-cpp-config.cmake Add the installation prefix of "yaml-cpp" to CMAKE_PREFIX_PATH or set "yaml-cpp_DIR" to a directory containing one of the above files. If "yaml-cpp" provides a separate development package or SDK, be sure it has been installed. -- Configuring incomplete, errors occurred!
The rosdep dependency seems to be resolving just fine (It installs libyaml-cpp-dev
properly and rosdep resolve yaml-cpp --os=debian:jessie
returns as expected). However, it seems that either the CMake config file either isn't being installed or is not being found. I'm not sure what to do about this, especially since it works in Ubuntu.
The package that's failing is the "rosflight" package at https://github.com/rosflight/rosfligh... . If you're set up to run ROS prerelease tests, the error can be reproduced using the following commands:
mkdir -p /tmp/prerelease_job
cd /tmp/prerelease_job
generate_prerelease_script.py \
https://raw.githubusercontent.com/ros-infrastructure/ros_buildfarm_config/production/index.yaml \
kinetic default debian jessie amd64 \
--custom-repo \
rosflight:git:https://github.com/rosflight/rosflight-release.git:release/kinetic/rosflight/0.1.2-0 \
rosflight_msgs:git:https://github.com/rosflight/rosflight-release.git:release/kinetic/rosflight_msgs/0.1.2-0 \
rosflight_pkgs:git:https://github.com/rosflight/rosflight-release.git:release/kinetic/rosflight_pkgs/0.1.2-0 \
rosflight_utils:git:https://github.com/rosflight/rosflight-release.git:release/kinetic/rosflight_utils/0.1.2-0 \
--level 0 \
--output-dir ./
./prerelease.sh
Any insights would be appreciated!
Is
yam-cpp
a CMake package on Debian? I remember having to usePkgConfig
like this:@gvdhoorn That appears to have resolved my issue, thanks! Switching to
PkgConfig
seems to work for both Ubuntu and Debian, although I did have to change from${YAML_CPP_INCLUDE_DIR}
to${YAML_CPP_INCLUDEDIR}
(I used aYAML_CPP
prefix instead ofyaml_cpp
inpkg_check_modules()
).