CMakeLists.txt 13.9 KB
Newer Older
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
1
#
Justin Carpentier's avatar
Justin Carpentier committed
2
# Copyright (c) 2015-2021 CNRS INRIA
3
# Copyright (c) 2015 Wandercraft, 86 rue de Paris 91400 Orsay, France.
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
4
5
#

6
CMAKE_MINIMUM_REQUIRED(VERSION 3.0)
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
7

8
9
10
11
SET(PROJECT_NAME pinocchio)
SET(PROJECT_DESCRIPTION "A fast and flexible implementation of Rigid Body Dynamics algorithms and their analytical derivatives")
SET(PROJECT_URL "http://github.com/stack-of-tasks/pinocchio")
SET(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
12
13
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
SET(PROJECT_USE_KEYWORD_LINK_LIBRARIES TRUE)
14

15
16
17
18
# Disable -Werror on Unix for now.
SET(CXX_DISABLE_WERROR True)
SET(CMAKE_VERBOSE_MAKEFILE True)

19
# Check if the submodule cmake have been initialized
Justin Carpentier's avatar
Justin Carpentier committed
20
IF(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/cmake/base.cmake")
21
22
23
  MESSAGE(FATAL_ERROR "\nPlease run the following command first:\ngit submodule update --init\n")
ENDIF()

24
SET(DOXYGEN_USE_MATHJAX YES)
25
SET(DOXYGEN_USE_TEMPLATE_CSS YES)
26

Justin Carpentier's avatar
Justin Carpentier committed
27
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/cmake/base.cmake)
28
29
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
30

Justin Carpentier's avatar
Justin Carpentier committed
31
32
33
34
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/cmake/boost.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/cmake/python.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/cmake/ide.cmake)
INCLUDE(${CMAKE_CURRENT_LIST_DIR}/cmake/apple.cmake)
35
36
37
IF(APPLE) # Use the handmade approach
  SET(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake/find-external/OpenMP ${CMAKE_MODULE_PATH})
ENDIF(APPLE)
Justin Carpentier's avatar
Justin Carpentier committed
38
INCLUDE(CMakeDependentOption)
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
39

Justin Carpentier's avatar
Justin Carpentier committed
40
# If needed, set CMake policy for APPLE systems
41
APPLY_DEFAULT_APPLE_CONFIGURATION()
42

43
44
45
46
47
48
IF(WIN32)
  SET(LINK copy_if_different)
ELSE(WIN32)
  SET(LINK create_symlink)
ENDIF(WIN32)

49
# --- OPTIONS ----------------------------------------
Justin Carpentier's avatar
Justin Carpentier committed
50
51
OPTION(BUILD_BENCHMARK "Build the benchmarks" OFF)
OPTION(BUILD_UTILS "Build the utils" OFF)
Justin Carpentier's avatar
Justin Carpentier committed
52
OPTION(BUILD_PYTHON_INTERFACE "Build the Python bindings" ON)
Justin Carpentier's avatar
Justin Carpentier committed
53
OPTION(BUILD_WITH_COMMIT_VERSION "Build libraries by setting specific commit version" OFF)
54

55
IF(DEFINED BUILD_UNIT_TESTS)
56
57
58
  MESSAGE(AUTHOR_WARNING "BUILD_UNIT_TESTS is deprecated. Use BUILD_TESTING instead.\
    If you are manually building Pinocchio from source in an existing build folder,\
    we suggest that you delete your build folder and make a new one.")
59
60
61
  SET(BUILD_TESTING ${BUILD_UNIT_TESTS})
ENDIF(DEFINED BUILD_UNIT_TESTS)

62
63
OPTION(BUILD_ADVANCED_TESTING "Build the advanced tests (multiprecision, etc.) of Pinocchio" OFF)

64
65
# --- OPTIONAL DEPENDENCIES -------------------------
OPTION(BUILD_WITH_URDF_SUPPORT "Build the library with the URDF format support" ON)
Justin Carpentier's avatar
Justin Carpentier committed
66
67
68
69
OPTION(BUILD_WITH_COLLISION_SUPPORT "Build the library with the collision support (required HPP-FCL)" OFF)
OPTION(BUILD_WITH_AUTODIFF_SUPPORT "Build the library with the automatic differentiation support (via CppAD)" OFF)
OPTION(BUILD_WITH_CASADI_SUPPORT "Build the library with the support of CASADI" OFF)
OPTION(BUILD_WITH_CODEGEN_SUPPORT "Build the library with the support of code generation (via CppADCodeGen)" OFF)
Justin Carpentier's avatar
Justin Carpentier committed
70
OPTION(BUILD_WITH_OPENMP_SUPPORT "Build the library with the OpenMP support" OFF)
71
cmake_dependent_option(LINK_PYTHON_INTERFACE_TO_OPENM "Link OpenMP to the Python interface" ON BUILD_WITH_OPENMP_SUPPORT OFF)
72

Justin Carpentier's avatar
Justin Carpentier committed
73
OPTION(INITIALIZE_WITH_NAN "Initialize Eigen entries with NaN" OFF)
74

75
76
77
78
79
80
81
82
83
IF(BUILD_WITH_COLLISION_SUPPORT)
  SET(BUILD_WITH_HPP_FCL_SUPPORT TRUE)
ENDIF()
IF(BUILD_WITH_AUTODIFF_SUPPORT)
  SET(BUILD_WITH_CPPAD_SUPPORT TRUE)
ENDIF()
IF(BUILD_WITH_CODEGEN_SUPPORT)
  SET(BUILD_WITH_CPPAD_CODEGEN_SUPPORT TRUE)
ENDIF()
Justin Carpentier's avatar
Justin Carpentier committed
84
85

IF(INITIALIZE_WITH_NAN)
jcarpent's avatar
jcarpent committed
86
  MESSAGE (STATUS "Initialize with NaN all the Eigen entries.")
87
  ADD_DEFINITIONS(-DEIGEN_INITIALIZE_MATRICES_BY_NAN)
Justin Carpentier's avatar
Justin Carpentier committed
88
ENDIF(INITIALIZE_WITH_NAN)
89

90
91
92
93
MACRO(TAG_LIBRARY_VERSION target)
  SET_TARGET_PROPERTIES(${target} PROPERTIES SOVERSION ${PROJECT_VERSION})
ENDMACRO(TAG_LIBRARY_VERSION)

94
95
SET(PINOCCHIO_MODEL_DIR "${PROJECT_SOURCE_DIR}/models")

Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
96
# ----------------------------------------------------
Wolfgang Merkt's avatar
Typo    
Wolfgang Merkt committed
97
# --- DEPENDENCIES -----------------------------------
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
98
# ----------------------------------------------------
99
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/find-external/CppAD/" ${CMAKE_MODULE_PATH})
100
ADD_PROJECT_DEPENDENCY(Eigen3 REQUIRED PKG_CONFIG_REQUIRES "eigen3 >= 3.0.5")
101

Joseph Mirabel's avatar
Joseph Mirabel committed
102
103
104
# Variable containing all the cflags definition relative to optional dependencies
SET(CFLAGS_DEPENDENCIES)

105
IF(BUILD_WITH_URDF_SUPPORT)
106
107
108
  ADD_PROJECT_DEPENDENCY(urdfdom_headers)
  ADD_PROJECT_DEPENDENCY(urdfdom PKG_CONFIG_REQUIRES "urdfdom >= 0.2.0")
  SET(urdfdom_VERSION ${urdfdom_headers_VERSION})
Justin Carpentier's avatar
Justin Carpentier committed
109
110
  ADD_DEFINITIONS(-DPINOCCHIO_WITH_URDFDOM)
  LIST(APPEND CFLAGS_DEPENDENCIES "-DPINOCCHIO_WITH_URDFDOM")
111

112
  IF(${urdfdom_VERSION} VERSION_GREATER "0.4.2")
113
114
115
    SET(CMAKE_CXX_STANDARD 11)
    SET(CMAKE_CXX_STANDARD_REQUIRED ON)
    MESSAGE(STATUS "Since urdfdom >= 1.0.0, the default C++ standard is C++11. The project is then compiled with C++11 standard.")
116
  ENDIF(${urdfdom_VERSION} VERSION_GREATER "0.4.2")
117
ENDIF(BUILD_WITH_URDF_SUPPORT)
118

119
IF(BUILD_WITH_AUTODIFF_SUPPORT)
120
121
  # Check first CppADCodeGen
  IF(BUILD_WITH_CODEGEN_SUPPORT)
122
    ADD_PROJECT_DEPENDENCY(cppadcg 2.4.1 REQUIRED PKG_CONFIG_REQUIRES "cppadcg >= 2.4.1") # CppADCodeGen 2.4.1 is the first version to check the minimal version of CppAD
123
  ENDIF(BUILD_WITH_CODEGEN_SUPPORT)
124

125
  ADD_PROJECT_DEPENDENCY(cppad 20180000.0 REQUIRED PKG_CONFIG_REQUIRES "cppad >= 20180000.0")
Justin Carpentier's avatar
Justin Carpentier committed
126
ENDIF(BUILD_WITH_AUTODIFF_SUPPORT)
127

128
IF(BUILD_WITH_CASADI_SUPPORT)
129
130
  ADD_PROJECT_DEPENDENCY(casadi 3.4.5 REQUIRED PKG_CONFIG_REQUIRES "casadi >= 3.4.5")
ENDIF(BUILD_WITH_CASADI_SUPPORT)
131

Justin Carpentier's avatar
Justin Carpentier committed
132
133
134
135
IF(BUILD_WITH_OPENMP_SUPPORT)
  FIND_PACKAGE(OpenMP REQUIRED)
ENDIF(BUILD_WITH_OPENMP_SUPPORT)

Sébastien Barthélémy's avatar
Sébastien Barthélémy committed
136
SET(BOOST_REQUIRED_COMPONENTS filesystem serialization system)
137

138
SET_BOOST_DEFAULT_OPTIONS()
139
EXPORT_BOOST_DEFAULT_OPTIONS()
140
ADD_PROJECT_DEPENDENCY(Boost REQUIRED COMPONENTS ${BOOST_REQUIRED_COMPONENTS})
jcarpent's avatar
jcarpent committed
141

142
IF(BUILD_PYTHON_INTERFACE)
143
144
  MESSAGE(STATUS "The Python bindings of Pinocchio will be compiled along the main library. If you want to disable this feature, please set the option BUILD_PYTHON_INTERFACE to OFF.")
  FINDPYTHON(REQUIRED)
145
  SEARCH_FOR_BOOST_PYTHON(REQUIRED)
146
  ADD_PROJECT_DEPENDENCY(eigenpy 2.6.2 REQUIRED)
147
148
149
150
151
152
  
  # Check wether this a PyPy Python
  EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import platform; print(platform.python_implementation())"
    OUTPUT_VARIABLE _python_implementation_value
    OUTPUT_STRIP_TRAILING_WHITESPACE
    ERROR_QUIET)
Justin Carpentier's avatar
Justin Carpentier committed
153
154
  
  MESSAGE(STATUS "Python compiler: ${_python_implementation_value}")
155
  IF(_python_implementation_value MATCHES "PyPy")
Justin Carpentier's avatar
Justin Carpentier committed
156
    SET(BUILD_PYTHON_INTERFACE_WITH_PYPY TRUE)
157
158
  ENDIF()
  
159
160
ELSE(BUILD_PYTHON_INTERFACE)
  MESSAGE(STATUS "Pinocchio won't be compiled with its Python bindings. If you want to enable this feature, please set the option BUILD_PYTHON_INTERFACE to ON.")
161
162
ENDIF(BUILD_PYTHON_INTERFACE)

163
164
165
IF(BUILD_WITH_HPP_FCL_SUPPORT)
  ADD_DEFINITIONS(-DPINOCCHIO_WITH_HPP_FCL)
  LIST(APPEND CFLAGS_DEPENDENCIES "-DPINOCCHIO_WITH_HPP_FCL")
166
  ADD_PROJECT_DEPENDENCY(hpp-fcl 1.7.3 REQUIRED PKG_CONFIG_REQUIRES "hpp-fcl >= 1.7.3")
167
168
169
170
171
172
173
174
175
  # Check whether hpp-fcl python bindings are available.
  SET(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS FALSE)
  IF(BUILD_PYTHON_INTERFACE)
    EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} -c "import hppfcl"
      RESULT_VARIABLE _hpp_fcl_python_bindings_not_found
      OUTPUT_QUIET
      ERROR_QUIET)
    IF(_hpp_fcl_python_bindings_not_found EQUAL 0)
      SET(BUILD_WITH_HPP_FCL_PYTHON_BINDINGS TRUE)
Justin Carpentier's avatar
Justin Carpentier committed
176
      MESSAGE(STATUS "Found hpp-fcl Python bindings.")
177
    ELSE()
Justin Carpentier's avatar
Justin Carpentier committed
178
      MESSAGE(STATUS "hpp-fcl Python bindings NOT found.")
179
180
181
182
183
    ENDIF()
    UNSET(_hpp_fcl_python_bindings_not_found)
  ENDIF(BUILD_PYTHON_INTERFACE)
ENDIF(BUILD_WITH_HPP_FCL_SUPPORT)

Justin Carpentier's avatar
Justin Carpentier committed
184
185
186
187
188
189
# Enforce the preprocessed version of boost::list and boost::vector
# This information is redundant with the content of include/pinocchio/container/boost-container-limits.hpp
# but it avoids any compilation issue.
ADD_DEFINITIONS(-DBOOST_MPL_LIMIT_LIST_SIZE=30)
ADD_DEFINITIONS(-DBOOST_MPL_LIMIT_VECTOR_SIZE=30)

190
# Path to boost headers
191
INCLUDE_DIRECTORIES(SYSTEM ${Boost_INCLUDE_DIRS})
192

Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
193
194
195
# ----------------------------------------------------
# --- INCLUDE ----------------------------------------
# ----------------------------------------------------
196
197
198
199
FILE(GLOB_RECURSE HEADERS 
     ${PROJECT_SOURCE_DIR}/src/*.hpp 
     ${PROJECT_SOURCE_DIR}/src/*.hxx 
     ) 
200

Justin Carpentier's avatar
Justin Carpentier committed
201
IF(NOT BUILD_WITH_URDF_SUPPORT)
202
203
204
205
206
207
208
  LIST(REMOVE_ITEM HEADERS
    ${PROJECT_SOURCE_DIR}/src/parsers/urdf.hpp
    ${PROJECT_SOURCE_DIR}/src/parsers/urdf/model.hxx
    ${PROJECT_SOURCE_DIR}/src/parsers/urdf/geometry.hxx
    ${PROJECT_SOURCE_DIR}/src/parsers/urdf/utils.hpp
    ${PROJECT_SOURCE_DIR}/src/parsers/urdf/types.hpp
    )
Justin Carpentier's avatar
Justin Carpentier committed
209
ENDIF(NOT BUILD_WITH_URDF_SUPPORT)
210

Justin Carpentier's avatar
Justin Carpentier committed
211
IF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
212
213
214
  LIST(REMOVE_ITEM HEADERS 
    ${PROJECT_SOURCE_DIR}/src/spatial/fcl-pinocchio-conversions.hpp
    )
Justin Carpentier's avatar
Justin Carpentier committed
215
ENDIF(NOT BUILD_WITH_HPP_FCL_SUPPORT)
216

217
LIST(APPEND HEADERS macros.hpp)
218

Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
219
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio")
220
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/core")
221
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/math")
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
222
223
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/spatial")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody")
224
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody/joint")
225
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody/liegroup")
226
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody/pool")
227
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/multibody/visitor")
228
229
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/parsers/urdf")
jcarpent's avatar
jcarpent committed
230
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/utils")
231
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/serialization")
232
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/algorithm")
233
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/algorithm/parallel")
234
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/container")
235
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/codegen")
236
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff")
237
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/casadi")
238
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/casadi/math")
239
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/casadi/spatial")
240
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/casadi/utils")
241
242
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad")
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad/spatial")
243
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad/math")
Rohan Budhiraja's avatar
Rohan Budhiraja committed
244
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad/algorithm")
245
MAKE_DIRECTORY("${${PROJECT_NAME}_BINARY_DIR}/include/pinocchio/autodiff/cppad/utils")
246

247
SET(HEADERS_)
248
FOREACH(header ${HEADERS})
249
  STRING(REGEX REPLACE "${PROJECT_SOURCE_DIR}/src/" "" header ${header})
250
  LIST(APPEND HEADERS_ ${header})
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
251
  GET_FILENAME_COMPONENT(headerName ${header} NAME)
252
253
254
255
256
  GET_FILENAME_COMPONENT(headerPath ${header} PATH)
  EXECUTE_PROCESS(COMMAND ${CMAKE_COMMAND} -E ${LINK}
    ${${PROJECT_NAME}_SOURCE_DIR}/src/${header}
    ${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/${header})
  INSTALL(FILES ${${PROJECT_NAME}_SOURCE_DIR}/src/${header}
Justin Carpentier's avatar
Justin Carpentier committed
257
          DESTINATION ${CMAKE_INSTALL_PREFIX}/include/${PROJECT_NAME}/${headerPath}
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
258
259
          PERMISSIONS OWNER_READ GROUP_READ WORLD_READ OWNER_WRITE)
ENDFOREACH(header)
260
SET(HEADERS ${HEADERS_})
Nicolas Mansard's avatar
IVIGIT.  
Nicolas Mansard committed
261

262
263
264
265
266
LIST(APPEND HEADERS
     ${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/config.hpp
     ${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/deprecated.hpp
     ${${PROJECT_NAME}_BINARY_DIR}/include/${PROJECT_NAME}/warning.hpp)

267
# --- MAIN LIBRARY -------------------------------------------------------------
268
ADD_SUBDIRECTORY(src)
269
270
271
272

# --- BINDINGS -----------------------------------------------------------------
ADD_SUBDIRECTORY(bindings)

273
# --- EXECUTABLES --------------------------------------------------------------
274
275
276
ADD_SUBDIRECTORY(utils)

# --- UNIT TESTS ---------------------------------------------------------------
277
ADD_SUBDIRECTORY(unittest)
278

279
# --- CHECK EXAMPLES -----------------------------------------------------------
280
ADD_SUBDIRECTORY(examples)
281

282
# --- BENCHMARKS ---------------------------------------------------------------
283
ADD_SUBDIRECTORY(benchmark)
jcarpent's avatar
jcarpent committed
284

285
# --- PACKAGING ----------------------------------------------------------------
286
287
288
289
290
291
292
293
294
MACRO(EXPORT_VARIABLE var_name var_value)
  GET_DIRECTORY_PROPERTY(has_parent PARENT_DIRECTORY)
  IF(has_parent)
    SET(${var_name} ${var_value} PARENT_SCOPE)
  ELSE()
    SET(${var_name} ${var_value})
  ENDIF()
ENDMACRO(EXPORT_VARIABLE var_name var_value)

Justin Carpentier's avatar
Justin Carpentier committed
295
IF(BUILD_WITH_URDF_SUPPORT)
296
  EXPORT_VARIABLE(PINOCCHIO_USE_URDFDOM ON)
Justin Carpentier's avatar
Justin Carpentier committed
297
298
299
  SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_URDFDOM \"\")")
ENDIF()
IF(BUILD_WITH_HPP_FCL_SUPPORT)
300
  EXPORT_VARIABLE(PINOCCHIO_USE_HPP_FCL ON)
Justin Carpentier's avatar
Justin Carpentier committed
301
302
303
  SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_HPP_FCL \"\")")
ENDIF()
IF(BUILD_WITH_CPPAD_SUPPORT)
304
  EXPORT_VARIABLE(PINOCCHIO_USE_CPPAD ON)
Justin Carpentier's avatar
Justin Carpentier committed
305
306
307
  SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_CPPAD \"\")")
ENDIF()
IF(BUILD_WITH_CPPAD_CODEGEN_SUPPORT)
308
  EXPORT_VARIABLE(PINOCCHIO_USE_CPPAD_CODEGEN ON)
Justin Carpentier's avatar
Justin Carpentier committed
309
310
311
  SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_CPPAD_CODEGEN \"\")")
ENDIF()
IF(BUILD_WITH_CASADI_SUPPORT)
312
  EXPORT_VARIABLE(PINOCCHIO_USE_CASADI ON)
Justin Carpentier's avatar
Justin Carpentier committed
313
314
315
  SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_USE_CASADI \"\")")
ENDIF()
IF(BUILD_PYTHON_INTERFACE)
316
  EXPORT_VARIABLE(PINOCCHIO_WITH_PYTHON_INTERFACE ON)
Justin Carpentier's avatar
Justin Carpentier committed
317
318
319
  SET(PACKAGE_EXTRA_MACROS "${PACKAGE_EXTRA_MACROS}\nset(PINOCCHIO_WITH_PYTHON_INTERFACE \"\")")
ENDIF()

320
PKG_CONFIG_APPEND_LIBS(${PROJECT_NAME})
Sébastien Barthélémy's avatar
Sébastien Barthélémy committed
321
PKG_CONFIG_APPEND_BOOST_LIBS(${BOOST_REQUIRED_COMPONENTS})
Nicolas Mansard's avatar
Nicolas Mansard committed
322

323
324
325
FOREACH(cflags ${CFLAGS_DEPENDENCIES})
  PKG_CONFIG_APPEND_CFLAGS(${cflags})
ENDFOREACH(cflags ${CFLAGS_DEPENDENCIES})
Wolfgang Merkt's avatar
Wolfgang Merkt committed
326
327
328

# Install catkin package.xml
INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME})