cmake_minimum_required(VERSION 2.8.3) project(rostask) find_package(catkin REQUIRED COMPONENTS) catkin_package() include_directories(src ${catkin_INCLUDE_DIRS}) # copy the rostask command to bin so that we don't need rosrun for it add_custom_target(${PROJECT_NAME} ALL) add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E make_directory ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_BIN_DESTINATION} COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/rostask" ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_BIN_DESTINATION} ) message("Copying rostask into ${CATKIN_DEVEL_PREFIX}/${CATKIN_GLOBAL_BIN_DESTINATION}")