-
Notifications
You must be signed in to change notification settings - Fork 4
/
CMakeLists.txt
55 lines (44 loc) · 1.76 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
52
53
54
55
cmake_minimum_required(VERSION 3.2)
# These variables have to be defined before running SETUP_PROJECT
set(PROJECT_NAME pinocchio-gepetto-viewer)
set(PROJECT_DESCRIPTION "")
set(PROJECT_URL http://github.com/jmirabel/pinocchio-gepetto-viewer)
set(PROJECT_USE_CMAKE_EXPORT TRUE)
set(PROJECT_CUSTOM_HEADER_EXTENSION "hpp")
set(DOXYGEN_USE_TEMPLATE_CSS ON)
set(DOXYGEN_INPUT "\"${CMAKE_SOURCE_DIR}/include\" \"${CMAKE_SOURCE_DIR}/src\" \"${CMAKE_SOURCE_DIR}/doc\"")
set(DOXYGEN_FILE_PATTERNS "*.cpp *.hpp")
set(DOXYGEN_MACRO_EXPANSION "YES")
set(CXX_DISABLE_WERROR ON)
include(cmake/base.cmake)
include(cmake/boost.cmake)
include(cmake/python.cmake)
COMPUTE_PROJECT_ARGS(PROJECT_ARGS LANGUAGES CXX)
project(${PROJECT_NAME} ${PROJECT_ARGS})
option(BUILD_TESTS "Build tests" ON)
option(BUILD_PLUGINS "Build plugins" OFF)
# Add a required dependency
add_project_dependency(gepetto-viewer-corba REQUIRED)
add_project_dependency(pinocchio REQUIRED)
if(BUILD_PLUGINS)
add_project_dependency(gepetto-viewer REQUIRED)
check_minimal_cxx_standard(11 ENFORCE)
add_subdirectory(plugins)
endif()
set(${PROJECT_NAME}_HEADERS
include/pinocchio/gepetto/viewer.hpp
include/pinocchio/gepetto/viewer.hxx)
add_library(pinocchio-gepetto-viewer SHARED
${${PROJECT_NAME}_HEADERS}
src/viewer.cc)
target_link_libraries(pinocchio-gepetto-viewer PUBLIC pinocchio::pinocchio gepetto-viewer-corba::gepetto-viewer-corba)
target_include_directories(pinocchio-gepetto-viewer PUBLIC $<INSTALL_INTERFACE:include>)
if(BUILD_TESTS)
add_executable(ur5 tests/ur5.cc)
target_link_libraries(ur5 PRIVATE pinocchio-gepetto-viewer)
add_test(NAME ur5 COMMAND ur5)
endif()
install(TARGETS pinocchio-gepetto-viewer
EXPORT ${TARGETS_EXPORT_NAME}
DESTINATION lib)
pkg_config_append_libs(${PROJECT_NAME})