-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
134 lines (102 loc) · 4.31 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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
##############################################################################
# Project
##############################################################################
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
project (delphyne_gui)
string (TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
string (TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)
set (PROJECT_MAJOR_VERSION 0)
set (PROJECT_MINOR_VERSION 1)
set (PROJECT_PATCH_VERSION 1)
set (PROJECT_VERSION ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION})
set (PROJECT_VERSION_FULL ${PROJECT_MAJOR_VERSION}.${PROJECT_MINOR_VERSION}.${PROJECT_PATCH_VERSION})
message (STATUS "${PROJECT_NAME} version ${PROJECT_VERSION_FULL}")
##############################################################################
# CMake Support
##############################################################################
# Use GNUInstallDirst to get canonical paths
include(GNUInstallDirs)
set (project_cmake_dir ${PROJECT_SOURCE_DIR}/cmake
CACHE PATH "Location of CMake scripts")
##############################################################################
# Project Configuration
##############################################################################
message(STATUS "\n\n========= Project Configuration ========\n")
set(BUILD_SHARED_LIBS true)
include(${project_cmake_dir}/DefaultCFlags.cmake)
# Check whether sanitizers should be enabled or not.
include(${project_cmake_dir}/SanitizersConfig.cmake)
##############################################################################
# Find 3rd Party Packages
##############################################################################
message(STATUS "\n\n====== Finding 3rd Party Packages ======\n")
find_package(ament_cmake REQUIRED)
# ignition
find_package(ignition-common3 REQUIRED)
find_package(ignition-math6 REQUIRED)
find_package(ignition-msgs5 REQUIRED)
find_package(ignition-gui3 REQUIRED)
find_package(ignition-rendering3 REQUIRED)
find_package(ignition-transport8 REQUIRED)
# Qt
find_package(Qt5Widgets REQUIRED)
find_package(Qt5Core REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Quick REQUIRED)
find_package(Qt5QuickControls2 REQUIRED)
find_package(Qt5Test REQUIRED)
# delphyne, drake and maliput
find_package(drake_vendor REQUIRED)
find_package(delphyne REQUIRED)
find_package(maliput REQUIRED)
# TODO(#443): Probably drake_vendor exposes its own ignition-math6 which
# collides with the ignition-exported one.
find_package(ignition-math6 REQUIRED)
set (CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)
set (BUILD_DELPHYNE ON CACHE INTERNAL
"Build Delphyne GUI" FORCE)
include (${project_cmake_dir}/DissectVersion.cmake)
########################################
# Write the config.hh file
configure_file (${project_cmake_dir}/config.hh.in
${PROJECT_BINARY_DIR}/include/${PROJECT_NAME}/config.hh)
include_directories(
# This include path is required to find the config.hh file. It won't be
# installed but it is required in the build space.
${PROJECT_BINARY_DIR}/include
${PROJECT_BINARY_DIR}/visualizer
)
link_directories(${PROJECT_BINARY_DIR}/src)
##############################################################################
# Tests
##############################################################################
if (BUILD_TESTING)
set(TEST_TYPE "UNIT")
enable_testing()
find_package(ament_cmake_clang_format REQUIRED)
find_package(ament_cmake_flake8 REQUIRED)
find_package(ament_cmake_gtest REQUIRED)
ament_flake8("--config" ${CMAKE_CURRENT_SOURCE_DIR}/.flake8)
ament_clang_format(CONFIG_FILE ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format)
endif()
##############################################################################
# Docs
##############################################################################
if(BUILD_DOCS)
message(STATUS "Doxygen generation - Enabled")
find_package(ament_cmake_doxygen REQUIRED)
ament_doxygen_generate(doxygen_maliput_malidrive
CONFIG_OVERLAY doc/Doxyfile.overlay.in
DEPENDENCIES delphyne maliput
)
add_definitions(-DBUILD_DOCS)
else()
message(STATUS "Doxygen generation - Disabled")
endif()
add_subdirectory(visualizer)
add_subdirectory(python)
ament_environment_hooks(setup.sh.in)
#################################################
# Installs maliput_viewer2.sh as a shortcut to run the visualizer.
install (PROGRAMS tools/maliput_viewer.sh DESTINATION bin)
ament_package()