forked from chili-epfl/hoap3_description
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (48 loc) · 1.91 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
56
cmake_minimum_required(VERSION 3.10)
cmake_policy(SET CMP0048 NEW)
project(hoap3_description VERSION 1.0.7)
if(NOT DISABLE_ROS)
if(NOT DEFINED ENV{ROS_VERSION})
message(FATAL_ERROR "ROS_VERSION is not set in the environment")
endif()
if($ENV{ROS_VERSION} EQUAL 1)
set(ROS_VERSION 1)
find_package(catkin REQUIRED)
elseif($ENV{ROS_VERSION} EQUAL 2)
set(ROS_VERSION 2)
find_package(ament_cmake REQUIRED)
else()
message(FATAL_ERROR "Unknown ROS version: $ENV{ROS_VERSION}")
endif()
else()
set(ROS_VERSION 0)
endif()
if(${ROS_VERSION} EQUAL 1)
catkin_package()
elseif(${ROS_VERSION} EQUAL 2)
set(CATKIN_PACKAGE_SHARE_DESTINATION share/${PROJECT_NAME})
else()
set(CATKIN_PACKAGE_SHARE_DESTINATION share/mc_rtc/${PROJECT_NAME})
include(CMakePackageConfigHelpers)
set(VERSION_CONFIG
"${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
set(PROJECT_CONFIG "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.cmake")
set(CONFIG_INSTALL_DIR "lib/cmake/${PROJECT_NAME}")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/ConfigVersion.cmake.in"
"${VERSION_CONFIG}" @ONLY)
configure_package_config_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/Config.cmake.in" "${PROJECT_CONFIG}"
INSTALL_DESTINATION "${CONFIG_INSTALL_DIR}")
install(FILES "${VERSION_CONFIG}" "${PROJECT_CONFIG}"
DESTINATION "${CONFIG_INSTALL_DIR}")
install(FILES package.xml DESTINATION "${CATKIN_PACKAGE_SHARE_DESTINATION}")
endif()
install(DIRECTORY convex/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/convex)
install(DIRECTORY meshes/
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/meshes)
install(DIRECTORY rsdf/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/rsdf)
install(DIRECTORY urdf/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/urdf)
if(${ROS_VERSION} EQUAL 2)
ament_package(CONFIG_EXTRAS cmake/hoap3_description_INSTALL_PREFIX.cmake)
endif()