Skip to content
Snippets Groups Projects
CMakeLists.txt 3.28 KiB
# Copyright (C) 2017 LAAS-CNRS
#
# Author: Olivier Stasse
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 2.8.3)

# Authorize warning error.
SET(CXX_DISABLE_WERROR)

include(cmake/base.cmake)
include(cmake/ros.cmake)
include(cmake/GNUInstallDirs.cmake)
include(cmake/python.cmake)

#project(talos_roscontrol_sot)

OPTION(REAL_ROBOT "Compiling this package for the real robot" FALSE)

find_package(PkgConfig REQUIRED)

add_required_dependency(bullet)

#set(bullet_FOUND 0)
#pkg_check_modules(bullet REQUIRED bullet)

## Find catkin macros and libraries
## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz)
## is used, also find other catkin packages
if(${REAL_ROBOT})
  set(additional_catkin_required_components
    controller_interface
    pal_hardware_interfaces
    )
else(${REAL_ROBOT})
  set(additional_catkin_required_components
    talos_controller_interface
    talos_pal_hardware_interfaces
    )
endif(${REAL_ROBOT})
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
  dynamic_graph_bridge
  control_msgs
  sensor_msgs
  realtime_tools
  ${additional_catkin_required_components}
)

## LAAS cmake submodule part
set(PROJECT_DESCRIPTION "Integration of the Stack of Tasks in roscontrol")
set(PROJECT_NAME talos_roscontrol_sot)
set(PROJECT_URL "ssh://git@redmine.laas.fr/laas/users/ostasse/pyrene-talos/metapkg_talos_roscontrol_sot.git")

set(CXX_DISABLE_WERROR False)

include_directories(include ${bullet_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})

link_directories(${bullet_LIBRARY_DIRS})

SETUP_PROJECT()

# 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
LIBRARIES rcsot_controller)

###########
## Build ##
###########

## Specify additional locations of header files
## Your package locations should be listed before other locations
# include_directories(include)
include_directories( 
  ${catkin_INCLUDE_DIRS}
  )

## Declare a C++ library
add_library(talos_rcsot_controller 
src/roscontrol-sot-controller.cpp
src/log.cpp
)

## Add cmake target dependencies of the executable
## same as for the library above
# add_dependencies(roscontrol_sot_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

## Specify libraries to link a library or executable target against
target_link_libraries(talos_rcsot_controller
  ${catkin_LIBRARIES}
  ${bullet_LIBRARIES}
  )


## Mark executables and/or libraries for installation
install(TARGETS talos_rcsot_controller DESTINATION lib )


foreach(dir config launch)
  install(DIRECTORY ${dir}
    DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
  )
endforeach()

SETUP_PROJECT_FINALIZE()