Select Git revision
CMakeLists.txt
Sebastian Ebert authored
CMakeLists.txt 4.69 KiB
cmake_minimum_required(VERSION 2.8.3)
project(panda_simulation)
add_compile_options(-std=c++14)
set(GCC_COVERAGE_COMPILE_FLAGS "-fpermissive")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GCC_COVERAGE_COMPILE_FLAGS} ${GAZEBO_CXX_FLAGS}")
# Find catkin macros and libraries if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) is used, also find other
# catkin packages
find_package(catkin REQUIRED
COMPONENTS controller_manager
effort_controllers
gazebo_ros
genmsg
joint_state_controller
joint_state_publisher
joint_trajectory_controller
robot_state_publisher
roscpp
std_msgs
tf
xacro
moveit_core
moveit_visual_tools
moveit_ros_planning
moveit_ros_planning_interface
controller_interface
hardware_interface)
# System dependencies are found with CMake's conventions
find_package(Boost REQUIRED COMPONENTS filesystem)
find_package(Protobuf 3 REQUIRED)
find_library(PahoMqtt3c libpaho-mqtt3c.so REQUIRED)
find_library(PahoMqtt3cs libpaho-mqtt3cs.so REQUIRED)
find_library(PahoMqtt3a libpaho-mqtt3a.so REQUIRED)
find_library(PahoMqtt3as libpaho-mqtt3as.so REQUIRED)
find_library(PahoMqttCpp libpaho-mqttpp3.so REQUIRED)
message("Lib PahoMqtt3c is at: ${PahoMqtt3c}")
message("Lib PahoMqtt3cs is at: ${PahoMqtt3cs}")
message("Lib PahoMqtt3a is at: ${PahoMqtt3a}")
message("Lib PahoMqtt3as is at: ${PahoMqtt3as}")
message("Lib PahoMqttCpp is at: ${PahoMqttCpp}")
find_package(PkgConfig REQUIRED)
pkg_check_modules(JSONCPP jsoncpp)
message(${JSONCPP_LIBRARIES})
# ################################################################################################################################
# catkin specific configuration ##
# ################################################################################################################################
# The catkin_package macro generates cmake config files for your package Declare things to be passed to dependent projects
catkin_package(CATKIN_DEPENDS
moveit_core
moveit_visual_tools
moveit_ros_planning_interface
controller_interface
hardware_interface
pluginlib
DEPENDS
# system_lib
)
# ################################################################################################################################
# Build ##
# ################################################################################################################################
# Specify additional locations of header files Your package locations should be listed before other locations
include_directories(${catkin_INCLUDE_DIRS})
# add custom controller as library
add_library(${PROJECT_NAME}_controllers_lib src/joint_position_controller.cpp)
add_library(linkstate src/linkstate.pb.cc src/linkstate.pb.h)
# Specify libraries to link a library or executable target against
target_link_libraries(${PROJECT_NAME}_controllers_lib ${catkin_LIBRARIES})
add_executable(robot_control_node src/robot_control_node.cpp)
add_executable(box_publisher_node src/box_publisher.cpp)
add_executable(robot_state_initializer_node src/robot_state_initializer.cpp)
add_executable(SafetyAwarePlanner src/SafetyAwarePlanner.cpp src/SafetyEnvironmentCreator.cpp)
add_executable(SampleConstraintPlanner src/SampleConstraintPlanner.cpp)
add_executable(RobotStateProvider src/RobotStateProvider.cpp src/mem_persistence.cpp)
add_executable(TimedCartesianPlanner src/TimedCartesianPlanner.cpp)
add_executable(MqttToRosNode src/MqttToRosNode.cpp)
target_link_libraries(robot_control_node ${catkin_LIBRARIES} boost_filesystem ${JSONCPP_LIBRARIES})
target_link_libraries(box_publisher_node ${catkin_LIBRARIES})
target_link_libraries(robot_state_initializer_node ${catkin_LIBRARIES})
target_link_libraries(SafetyAwarePlanner ${catkin_LIBRARIES})
target_link_libraries(SampleConstraintPlanner ${catkin_LIBRARIES} ${Boost_LIBRARIES})
target_link_libraries(RobotStateProvider LINK_PUBLIC
${catkin_LIBRARIES}
${PahoMqtt3c}
${PahoMqtt3cs}
${PahoMqtt3a}
${PahoMqtt3as}
${PahoMqttCpp}
${Protobuf_LIBRARIES}
linkstate)
target_link_libraries(MqttToRosNode LINK_PUBLIC
${catkin_LIBRARIES}
${PahoMqtt3c}
${PahoMqtt3cs}
${PahoMqtt3a}
${PahoMqtt3as}
${PahoMqttCpp})
target_link_libraries(TimedCartesianPlanner ${catkin_LIBRARIES})