Commit 00334b6b authored by Olivier Stasse's avatar Olivier Stasse

[cmake] Add detection of controller_interface and version extraction.

parent 5b2b426e
# Copyright (C) 2017 LAAS-CNRS
# Copyright (C) 2017-2018 LAAS-CNRS
#
# Author: Olivier Stasse
#
......@@ -42,6 +42,7 @@ find_package(catkin REQUIRED COMPONENTS
sensor_msgs
realtime_tools
controller_interface
pal_hardware_interfaces
)
## LAAS cmake submodule part
......@@ -57,12 +58,33 @@ link_directories(${bullet_LIBRARY_DIRS})
SETUP_PROJECT()
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin)
set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib)
set(CMAKE_INSTALL_RPATH "${LIBRARY_OUTPUT_PATH}")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${LIBRARY_OUTPUT_PATH}")
# Add dependency through jrl-cmakemodules to compile
# this code without catkin_make
add_required_dependency(roscpp)
add_required_dependency("realtime_tools >= 1.8")
add_required_dependency("dynamic_graph_bridge")
add_required_dependency("controller_interface")
add_required_dependency("pal_hardware_interfaces")
# This is necessary so that the pc file generated by catking is similar to the on
# done directly by jrl-cmake-modules
catkin_package(CATKIN_DEPENDS
roscpp realtime_tools message_runtime dynamic_graph_bridge
roscpp realtime_tools message_runtime dynamic_graph_bridge pal_hardware_interfaces controller_interface
LIBRARIES rcsot_controller)
# Detect the prf-ros-control version to switch code
if(CONTROLLER_INTERFACE_FOUND)
if (${CONTROLLER_INTERFACE_VERSION} VERSION_GREATER "0.2.5")
add_definitions(-DCONTROLLER_INTERFACE_KINETIC)
endif(${CONTROLLER_INTERFACE_VERSION} VERSION_GREATER "0.2.5")
endif(CONTROLLER_INTERFACE_FOUND)
###########
## Build ##
###########
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment