-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
77 lines (62 loc) · 2.58 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
cmake_minimum_required(VERSION 3.5)
################################################################################
# CMake
################################################################################
project(drake_vendor)
################################################################################
# Dependencies
################################################################################
find_package(ament_cmake_core REQUIRED)
################################################################################
# Configuration
################################################################################
ament_package_xml()
string(REPLACE "." ";" SEMANTIC_VERSION ${${PROJECT_NAME}_VERSION})
list(GET SEMANTIC_VERSION 0 MAJOR_VERSION)
list(GET SEMANTIC_VERSION 1 MINOR_VERSION)
list(GET SEMANTIC_VERSION 2 PATCH_VERSION)
string(LENGTH ${PATCH_VERSION} PATCH_LENGTH)
if(${PATCH_LENGTH} STREQUAL "8")
set(VERSION ${PATCH_VERSION})
else()
set(VERSION ${${PROJECT_NAME}_VERSION})
endif()
if (DEFINED ENV{DRAKE_INSTALL_PREFIX})
set(drake_DIR "$ENV{DRAKE_INSTALL_PREFIX}")
else()
set(drake_DIR "/opt/drake/${VERSION}")
endif()
set(drake_VERSION ${${PROJECT_NAME}_VERSION})
file(READ "${PROJECT_SOURCE_DIR}/VERSION.TXT" drake_EXPECTED_VERSION)
string(REPLACE " " ";" drake_EXPECTED_VERSION_LIST ${drake_EXPECTED_VERSION})
list(GET drake_EXPECTED_VERSION_LIST 0 drake_EXPECTED_RELEASE_DATE)
list(GET drake_EXPECTED_VERSION_LIST 1 drake_EXPECTED_RELEASE_COMMIT)
################################################################################
# Configuration Reporting
################################################################################
message(STATUS "Drake Install Dir............${drake_DIR}")
message(STATUS "Drake Release Date...........${drake_EXPECTED_RELEASE_DATE}")
message(STATUS "Drake Release Commmit........${drake_EXPECTED_RELEASE_COMMIT}")
##############################################################################
# Tests
##############################################################################
if(BUILD_TESTING)
find_package(ament_cmake_flake8 REQUIRED)
enable_testing()
ament_flake8("--config" ${CMAKE_CURRENT_SOURCE_DIR}/.flake8)
endif()
################################################################################
# Installation
################################################################################
install(
PROGRAMS
drake_installer
drake_version
DESTINATION bin
)
install(
FILES VERSION.TXT
DESTINATION share
)
ament_environment_hooks(cmake/drake-package_hook.sh.in)
ament_package(CONFIG_EXTRAS cmake/drake-extras.cmake.in)