# Revision history [back]

### Building catkin package with external dependency

Hello,

I am trying to build a catkin package (skeleton_markers) that depends on the Ubuntu packages freeglut3 and freeglut3-dev. I tried to use:

find_package(PkgConfig)
pkg_check_modules(GLUT freeglut3)


<build_depend>freeglut3-dev</build_depend>


and

<run_depend>freeglut3</run_depend>


to my package.xml file but it turns out that freeglut3 does not have a .pc file so pkg-config cannot find it. After checking the catkin docs, I still cannot figure out how to add this external dependency to my build files.

P.S. The truth is I can use the following hack to get it to work on my machine:

# Find Glut
find_path(GLUT_INCLUDE_DIRS
NAMES glut.h
HINTS /usr/include/GL /usr/local/include/GL)
find_library(GLUT_LIBRARIES
NAMES libglut.so)


but this does not work on the ROS build farm because presumably it doesn't have freeglut3 installed and also, I need a user's machine to automatically install freeglut3 if it is not installed.

--patrick

### Building catkin package with external dependency

Hello,

I am trying to build a catkin package (skeleton_markers) that depends on the Ubuntu packages freeglut3 and freeglut3-dev. I tried to use:

find_package(PkgConfig)
pkg_check_modules(GLUT freeglut3)


<build_depend>freeglut3-dev</build_depend>


and

<run_depend>freeglut3</run_depend>


to my package.xml file but it turns out that freeglut3 does not have a .pc file so pkg-config cannot find it. After checking the catkin docs, I still cannot figure out how to add this external dependency to my build files.

P.S. The truth is I can use the following hack to get it to work on my machine:

# Find Glut
find_path(GLUT_INCLUDE_DIRS
NAMES glut.h
HINTS /usr/include/GL /usr/local/include/GL)
find_library(GLUT_LIBRARIES
NAMES libglut.so)


but this does not work on the ROS build farm because presumably it doesn't have freeglut3 installed and also, I need a user's machine to automatically install freeglut3 if it is not installed.

--patrick

UPDATE: Here are my package.xml and CMakeLists.txt files as well as a link to the latest build failure on Jenkins. The root of the problem seems to be the error message :

skeleton_markers/ARCH_PARAM/amd64/UBUNTU_PARAM/precise/label/prerelease/jenkins_scripts/rosdep.py", line 51, in to_apt
return self.r2a[ros_entry]
KeyError: 'freeglut3-dev


package.xml file:

<package>
<name>skeleton_markers</name>
<version>0.4.1</version>
<description>
Skeleton Markers: Publish a list of joint markers
for viewing in RViz.
</description>

<maintainer email="patrick@pirobot.org">Patrick Goebel</maintainer>
<url type="website">http://ros.org/wiki/skeleton_markers</url>
<url type="https://github.com/pirobot/skeleton_markers/issues"></url>
<author email="patrick@pirobot.org">Patrick Goebel</author>

<buildtool_depend>catkin</buildtool_depend>

<build_depend>libopenni-dev</build_depend>
<build_depend>libopenni-nite-dev</build_depend>
<build_depend>libopenni-sensor-primesense-dev</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>tf</build_depend>
<build_depend>orocos_kdl</build_depend>
<build_depend>message_generation</build_depend>
<build_depend>visualization_msgs</build_depend>
<build_depend>std_msgs</build_depend>
<build_depend>geometry_msgs</build_depend>
<build_depend>openni_camera</build_depend>
<build_depend>openni_tracker</build_depend>
<build_depend>freeglut3-dev</build_depend>
<build_depend>rospy</build_depend>
<build_depend>roscpp</build_depend>

<run_depend>libopenni-dev</run_depend>
<run_depend>libopenni-nite-dev</run_depend>
<run_depend>libopenni-sensor-primesense-dev</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>orocos_kdl</run_depend>
<run_depend>message_runtime</run_depend>
<run_depend>visualization_msgs</run_depend>
<run_depend>std_msgs</run_depend>
<run_depend>geometry_msgs</run_depend>
<run_depend>tf</run_depend>
<run_depend>openni_camera</run_depend>
<run_depend>openni_tracker</run_depend>
<run_depend>freeglut3-dev</run_depend>
<run_depend>rospy</run_depend>
<run_depend>roscpp</run_depend>

</package>


CMakeLists.xml file:

cmake_minimum_required(VERSION 2.8.3)
project(skeleton_markers)

find_package(catkin REQUIRED COMPONENTS
roscpp
rospy
tf
geometry_msgs
message_generation)

# Find Orocos KDL
find_package(orocos_kdl REQUIRED)

# Find OpenNI
find_package(PkgConfig)
pkg_check_modules(OpenNI REQUIRED libopenni)

# Find Glut
find_package(GLUT REQUIRED)

${catkin_LIBRARY_DIRS}${Boost_LIBRARY_DIRS}
${orocos_kdl_LIBRARY_DIRS}${OpenNI_LIBRARIES}
${GLUT_LIBRARIES} ) include_directories(${catkin_INCLUDE_DIRS}
${OpenNI_INCLUDE_DIRS}${GLUT_INCLUDE_DIRS}
${orocos_kdl_INCLUDE_DIRS}) catkin_python_setup() add_message_files ( FILES Skeleton.msg ) generate_messages( DEPENDENCIES geometry_msgs std_msgs ) catkin_package( DEPENDS openni_camera openni_tracker CATKIN DEPENDS message_runtime rospy roscpp tf visualization_msgs std_msgs geometry_msgs ) add_executable(skeleton_tracker src/skeleton_tracker.cpp src/KinectController.cpp src/KinectDisplay.cpp) target_link_libraries(skeleton_tracker${catkin_LIBRARIES}
${OpenNI_LIBRARIES}${GLUT_LIBRARIES}
${orocos_kdl_LIBRARIES}) #install(TARGETS skeleton_tracker RUNTIME DESTINATION${CATKIN_PACKAGE_BIN_DESTINATION})
message("DEBUG variable catkin_INCLUDE_DIRS: ${catkin_INCLUDE_DIRS}") message("DEBUG variable OpenNI_INCLUDE_DIRS:${OpenNI_INCLUDE_DIRS}")
message("DEBUG variable GLUT_INCLUDE_DIRS: ${GLUT_INCLUDE_DIRS}") message("DEBUG variable orocos_kdl_INCLUDE_DIRS:${orocos_kdl_INCLUDE_DIRS}")