forked from Gepetto/example-robot-data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
51 lines (42 loc) · 1.77 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
# Project properties
SET(PROJECT_ORG gepetto)
SET(PROJECT_NAME example-robot-data)
SET(PROJECT_DESCRIPTION "Set of robot URDFs for benchmarking and developed examples.")
SET(PROJECT_URL https://github.com/${PROJECT_ORG}/${PROJECT_NAME})
# Project options
OPTION(BUILD_PYTHON_INTERFACE "Build the python unit tests and helpers" ON)
OPTION(INSTALL_PYTHON_INTERFACE_ONLY "Install *ONLY* the python interface" OFF)
# Project configuration
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
SET(PROJECT_USE_CMAKE_EXPORT TRUE)
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
SET(CUSTOM_HEADER_DIR ${PROJECT_NAME})
# JRL-cmakemodule setup
INCLUDE(cmake/base.cmake)
INCLUDE(cmake/python.cmake)
# Print initial message
MESSAGE(STATUS "${PROJECT_DESCRIPTION}, version ${PROJECT_VERSION}")
MESSAGE(STATUS "Copyright (C) 2018-2021 LAAS-CNRS, University of Edinburgh")
MESSAGE(STATUS "All rights reserved.")
MESSAGE(STATUS "Released under the BSD 3-Clause License.")
# Project definition
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
PROJECT(${PROJECT_NAME} ${PROJECT_ARGS})
IF(BUILD_PYTHON_INTERFACE)
FINDPYTHON()
ADD_PROJECT_DEPENDENCY(pinocchio)
STRING(REGEX REPLACE "-" "_" PY_NAME ${PROJECT_NAME})
ADD_SUBDIRECTORY(python)
IF(BUILD_TESTING)
ADD_SUBDIRECTORY(unittest)
ENDIF(BUILD_TESTING)
ENDIF(BUILD_PYTHON_INTERFACE)
IF(NOT INSTALL_PYTHON_INTERFACE_ONLY)
ADD_LIBRARY(${PROJECT_NAME} INTERFACE)
TARGET_INCLUDE_DIRECTORIES(${PROJECT_NAME} INTERFACE $<INSTALL_INTERFACE:include>)
INSTALL(TARGETS ${PROJECT_NAME} EXPORT ${TARGETS_EXPORT_NAME} DESTINATION lib)
ADD_SUBDIRECTORY(include/${CUSTOM_HEADER_DIR})
INSTALL(DIRECTORY robots DESTINATION share/${PROJECT_NAME})
INSTALL(FILES package.xml DESTINATION share/${PROJECT_NAME})
ENDIF(NOT INSTALL_PYTHON_INTERFACE_ONLY)