ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

point_cloud cmake problem: cannot specify link libraries for target

asked 2013-08-16 18:36:58 -0500

ljk gravatar image

updated 2016-10-24 09:02:42 -0500

ngrennan gravatar image

Hi my friends, I am using ros-fuerte on 12.04. I am trying to compile the example from http://correll.cs.colorado.edu/?p=2807 which runs on ros-groovy. I have created my own CMakeLists.txt in order to make, however i encountered the following problem after running "make":

> mkdir -p bin
cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=`rospack find rosbuild`/rostoolchain.cmake  ..
[rosbuild] Building package point_cloud_test
[rosbuild] Including /opt/ros/fuerte/share/roslisp/rosbuild/roslisp.cmake
[rosbuild] Including /opt/ros/fuerte/share/rospy/rosbuild/rospy.cmake
[rosbuild] Including /opt/ros/fuerte/share/roscpp/rosbuild/roscpp.cmake
WARN, found multiple boost versions '[(1, 46, 1, '/usr', '/usr/include', True, True), (1, 54, 0, '/usr/local', '/usr/local/include', True, True)]', using latestWARN, found multiple boost versions '[(1, 46, 1, '/usr', '/usr/include', True, True), (1, 54, 0, '/usr/local', '/usr/local/include', True, True)]', using latestCMake Error at /opt/ros/fuerte/share/ros/core/rosbuild/public.cmake:897 (target_link_libraries):
  Cannot specify link libraries for target "point_cloud_test" which is not
  built by this project.
Call Stack (most recent call first):
  CMakeLists.txt:28 (rosbuild_link_boost)


-- Configuring incomplete, errors occurred!
make: *** [all] Error 1

The CMakeLists.txt is :

    cmake_minimum_required(VERSION 2.4.6)
include($ENV{ROS_ROOT}/core/rosbuild/rosbuild.cmake)

# Set the build type.  Options are:
#  Coverage       : w/ debug symbols, w/o optimization, w/ code-coverage
#  Debug          : w/ debug symbols, w/o optimization
#  Release        : w/o debug symbols, w/ optimization
#  RelWithDebInfo : w/ debug symbols, w/ optimization
#  MinSizeRel     : w/o debug symbols, w/ optimization, stripped binaries
#set(ROS_BUILD_TYPE RelWithDebInfo)

rosbuild_init()

#set the default path for built executables to the "bin" directory
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)
#set the default path for built libraries to the "lib" directory
set(LIBRARY_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/lib)

#uncomment if you have defined messages
#rosbuild_genmsg()
#uncomment if you have defined services
#rosbuild_gensrv()

#common commands for building c++ executables and libraries
#rosbuild_add_library(${PROJECT_NAME} src/example.cpp)
#target_link_libraries(${PROJECT_NAME} another_library)
rosbuild_add_boost_directories()
rosbuild_link_boost(point_cloud_test thread)
rosbuild_add_executable(point_cloud_test src/point_cloud_test.cpp)
#target_link_libraries(point_cloud_test libboost.lib)

find_package(VTK)

include ("${VTK_USE_FILE}")

I think the problem will be editing target_link_libraries, but i do not know which library to add and how to add it. Could someone help to give some instructions? Thanks a lot in advance!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-08-19 02:02:53 -0500

ljk gravatar image

Problem solved by: rosbuild_add_boost_directories() rosbuild_add_library(point_cloud_test src/point_cloud_test.cpp) rosbuild_link_boost(point_cloud_test thread system) rosbuild_add_executable(point_cloud_test src/point_cloud_test.cpp)

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-08-16 18:36:58 -0500

Seen: 2,232 times

Last updated: Aug 16 '13