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

install destination error with my catkin package

asked 2013-02-04 00:17:52 -0600

Moirai gravatar image

updated 2014-01-28 17:15:05 -0600

ngrennan gravatar image

I installed Groovy and converted my package from rosbuild to catkin following a migration guide.
I wrote my CMakeLists.txt referenced Groovy's sources and CMakeLists.
I run catkin_make, failed about install DESTINATION.

Moirai@moirai:~/moirai-ws$ catkin_make
Base path: /home/Moirai/moirai-ws
Source space: /home/Moirai/moirai-ws/src
Build space: /home/Moirai/moirai-ws/build
Devel space: /home/Moirai/moirai-ws/devel
Install space: /home/Moirai/moirai-ws/install
####
#### Running command: "make cmake_check_build_system" in "/home/Moirai/moirai-ws/build"
####
-- Using CATKIN_DEVEL_PREFIX: /home/Moirai/moirai-ws/devel
-- Using CMAKE_PREFIX_PATH: /opt/ros/groovy
-- This workspace overlays: /opt/ros/groovy
-- Found gtest sources under '/usr/src/gtest': gtests will be built
-- catkin 0.5.63
-- BUILD_SHARED_LIBS is on
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- ~~  traversing packages in topological order:
-- ~~  - my_package
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-- +++ processing catkin package: 'my_package'
-- ==> add_subdirectory(my_package)
CMake Error at my_package/CMakeLists.txt:18 (install):
  install TARGETS given no RUNTIME DESTINATION for executable target
  "my_package_node".


My CMakeLists.txt is

cmake_minimum_required(VERSION 2.8.3)
project(my_package)

find_package(catkin REQUIRED COMPONENTS sensor_msgs driver_base image_proc dynamic_reconfigure camera_calibration_parsers compressed_image_transport cv_bridge rospack)
find_package(OpenCV REQUIRED)

# include files
include_directories(${catkin_INCLUDE_DIRS})
include_directories(SYSTEM ${OpenCV_INCLUDE_DIRS})
include_directories(src/my_package_uvc)
include_directories(${CATKIN_DEVEL_PREFIX}/include/my_package)

# create my_package_node
add_executable(my_package_node src/my_package_node.cpp  src/my_package_uvc/my_package_camera.cpp src/my_package_uvc/my_package_uvc.cpp)
target_link_libraries(my_package_node ${catkin_LIBRARIES} ${OpenCV_LIBRARIES})
install(TARGETS my_package_node
    DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

# define the project
   catkin_package(
   INCLUDE_DIRS src/my_package_uvc
   LIBRARIES ${PROJECT_NAME}
   CATKIN-DEPENDS sensor_msgs driver_base image_proc dynamic_reconfigure camera_calibration_parsers compressed_image_transport cv_bridge
   DEPENDS opencv
)


Where is ${CATKIN_PACKAGE_BIN_DESTINATION}?
What am I doing wrong?

edit retag flag offensive close merge delete

Comments

catkin_make run successfully when I set my workspace directory as install destination. install(TARGETS my_package_node DESTINATION ${CMAKE_INSTALL_PREFIX}/bin ) I don' know how to configure "${CATKIN_PACKAGE_BIN_DESTINATION}.

Moirai gravatar image Moirai  ( 2013-02-04 02:25:00 -0600 )edit

5 Answers

Sort by ยป oldest newest most voted
6

answered 2013-02-04 08:01:10 -0600

Dirk Thomas gravatar image

updated 2013-02-04 08:03:21 -0600

catkin_package() defines the variable CATKIN_PACKAGE_BIN_DESTINATION and must therefore be called before install(). In your case the variable has not been set and therefore the destination is empty.

Besides that your CMakeLists.txt contains several other flaws:

  • the include directories are ordered badly, first add your local stuff and then global things, else header from other workspaces will overlay your header

  • your include dir should not point to src/my_package_uvc but src instead, and then you should include the header with my_package_uvc/myfile.h.

  • the argument to catkin_package() is CATKIN_DEPENDS not CATKIN-DEPENDS

edit flag offensive delete link more

Comments

Thanks for your detailed advice. I finished my package's catkin migration! Thank you !!!

Moirai gravatar image Moirai  ( 2013-02-05 00:47:38 -0600 )edit
1

answered 2013-02-04 00:42:47 -0600

KruseT gravatar image

updated 2013-02-04 08:43:59 -0600

use this template for the install macro:

install(TARGETS foo foo_node
  ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
  RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

Also, in your CMakeLists.txt, I believe:

target_link_libraries(my_package ...

should be

target_link_libraries(my_package_node ...

and

catkin_package(
 INCLUDE_DIRS src/my_package_uvc
 LIBRARIES ${PROJECT_NAME}
 ...

should be

catkin_package(
 INCLUDE_DIRS src/my_package_uvc
 # LIBRARIES ${PROJECT_NAME}
 ...

UPDATE: Really use the catkin_create-pkg command for new packages, this generates a CMakeLists.txt for you which should help you make less mistakes.

edit flag offensive delete link more
1

answered 2013-02-04 00:44:25 -0600

Oier gravatar image

Hi, I'm no expert, but according to [0] you should place catkin_package before add_executable etc. Also I would try linking my_package node instead of my_package: target_link_libraries(my_package_node...

[0] http://www.ros.org/wiki/catkin/CMakeLists.txt#Overall_Structure_and_Ordering

edit flag offensive delete link more
0

answered 2021-03-16 22:03:49 -0600

bigbellmercy gravatar image

updated 2021-03-16 22:04:20 -0600

For the question 'Where is ${CATKIN_PACKAGE_BIN_DESTINATION}?', in my case, that location exists at '~/catkin_ws/devel/.private' The executable binary files are there.

edit flag offensive delete link more
0

answered 2013-02-04 02:47:28 -0600

Moirai gravatar image

Hi, thanks for your advice. I modified my CMakeLists.txt, but catkin_make failed with the same CMake Error.

catkin_make run successfully when I set my workspace directory as install destination.

 install(TARGETS my_package_node 
 DESTINATION ${CMAKE_INSTALL_PREFIX}/bin 
 )

I don't know how to configure "${CATKIN_PACKAGE_BIN_DESTINATION}.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-02-04 00:17:52 -0600

Seen: 11,368 times

Last updated: Mar 16 '21