CMakeLists.txt 2.8 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# 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/>.
Olivier Stasse's avatar
Olivier Stasse committed
17
cmake_minimum_required(VERSION 2.8.3)
18
19
20
21
22
23

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

Olivier Stasse's avatar
Olivier Stasse committed
24
25
26
27
project(roscontrol_sot)

find_package(PkgConfig REQUIRED)

28
29
30
31
add_required_dependency(bullet)

#set(bullet_FOUND 0)
#pkg_check_modules(bullet REQUIRED bullet)
Olivier Stasse's avatar
Olivier Stasse committed
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46

## 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
  roscpp
  rospy
  std_msgs
  dynamic_graph_bridge
  control_msgs
  sensor_msgs
  realtime_tools
  controller_interface
)

47
48
49
50
51
52
53
## LAAS cmake submodule part
set(PROJECT_DESCRIPTION "Integration of the Stack of Tasks in roscontrol")
set(PROJECT_NAME roscontrol_sot)
set(PROJECT_URL "https://github.com/stack-of-tasks/roscontrol_sot")

set(CXX_DISABLE_WERROR False)

Olivier Stasse's avatar
Olivier Stasse committed
54
55
56
57
include_directories(include ${bullet_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS})

link_directories(${bullet_LIBRARY_DIRS})

58
59
60
61
62
63
64
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)
Olivier Stasse's avatar
Olivier Stasse committed
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94

###########
## 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(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(rcsot_controller
  ${catkin_LIBRARIES}
  ${bullet_LIBRARIES}
  )


## Mark executables and/or libraries for installation
95
install(TARGETS rcsot_controller DESTINATION lib )
Olivier Stasse's avatar
Olivier Stasse committed
96
97
98
99
100
101
102
103


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

104
SETUP_PROJECT_FINALIZE()
Olivier Stasse's avatar
Olivier Stasse committed
105
106