-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
38 lines (31 loc) · 1.43 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
cmake_minimum_required(VERSION 3.1)
project(mc_fetch)
set(CMAKE_CXX_STANDARD 11)
find_package(mc_rtc REQUIRED)
find_description_package(fetch_description)
find_package(fetch_description REQUIRED)
if(${fetch_description_FOUND})
# FIXME: overwrite FETCH_DESCRIPTION_PATH
if(EXISTS ${fetch_description_INSTALL_PREFIX}/share/fetch_description/robots/fetch.urdf)
set(FETCH_DESCRIPTION_PATH ${fetch_description_INSTALL_PREFIX}/share/fetch_description)
elseif(EXISTS ${fetch_description_SOURCE_PREFIX}/robots/fetch.urdf)
set(FETCH_DESCRIPTION_PATH ${fetch_description_SOURCE_PREFIX})
else()
message(WARNING "Could not found fetch.urdf in ${fetch_description_INSTALL_PREFIX}/share/fetch_description/robots/fetch.urdf and ${fetch_description_SOURCE_PREFIX}/robots/fetch.urdf")
endif()
set(FETCH_NAME "fetch")
endif()
message("-- FETCH_DESCRIPTION_PATH: ${FETCH_DESCRIPTION_PATH}")
find_description_package(mc_fetch_description)
if(${mc_fetch_description_FOUND})
set(MC_FETCH_DESCRIPTION_PATH ${mc_fetch_description_SOURCE_PREFIX})
endif()
message("-- MC_FETCH_DESCRIPTION_PATH: ${MC_FETCH_DESCRIPTION_PATH}")
configure_file(src/config.h.in "${CMAKE_CURRENT_BINARY_DIR}/include/config.h")
add_robot(fetch src/fetch.cpp src/fetch.h)
target_include_directories(fetch PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/include")
option(DISABLE_TESTS "Disable unit tests" OFF)
if(NOT ${DISABLE_TESTS})
enable_testing()
add_subdirectory(tests)
endif()