-
Notifications
You must be signed in to change notification settings - Fork 3
/
CMakeLists.txt
63 lines (51 loc) · 2.5 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
cmake_minimum_required(VERSION 3.5)
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(default_build_type "Release")
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE STRING "Choose the type of build." FORCE)
endif()
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo" "SanitizeAddress" "SanitizeThread")
project(MRPTPathPlanningProject LANGUAGES CXX)
# Include std cmake scripts:
include(CheckCXXCompilerFlag) # for check_cxx_compiler_flag()
include(CMakeDetermineCXXCompiler)
# Our custom scripts:
include(cmake/script_version_number.cmake REQUIRED) # Loads version number from package.xml
include(cmake/misc_cmake_functions.cmake REQUIRED)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
if(CMAKE_COMPILER_IS_GNUCXX)
# BUILD_TYPE: SanitizeAddress
set(CMAKE_CXX_FLAGS_SANITIZEADDRESS "-fsanitize=address -fsanitize=leak -g")
set(CMAKE_EXE_LINKER_FLAGS_SANITIZEADDRESS "-fsanitize=address -fsanitize=leak")
set(CMAKE_SHARED_LINKER_FLAGS_SANITIZEADDRESS "-fsanitize=address -fsanitize=leak")
# BUILD_TYPE: SanitizeThread
set(CMAKE_CXX_FLAGS_SANITIZETHREAD "-fsanitize=thread -g")
set(CMAKE_EXE_LINKER_FLAGS_SANITIZETHREAD "-fsanitize=thread")
set(CMAKE_SHARED_LINKER_FLAGS_SANITIZETHREAD "-fsanitize=thread")
endif()
# Dependencies:
find_package(mvsim-simulator QUIET)
find_package(mrpt-tclap REQUIRED)
find_package(mrpt-containers REQUIRED)
find_package(mrpt-graphs REQUIRED)
find_package(mrpt-gui REQUIRED)
find_package(mrpt-nav REQUIRED)
find_package(mrpt-maps REQUIRED)
# Targets:
add_subdirectory(mrpt_path_planning)
option(MRPT_PATH_PLANNING_BUILD_APPS "Build mrpt_path_planning cli/gui tools" ON)
if (MRPT_PATH_PLANNING_BUILD_APPS)
add_subdirectory(apps)
endif()
# Summary:
message(STATUS "")
message(STATUS "${PROJECT_NAME} version ${MRPT_PATH_PLANNING_VERSION}")
message(STATUS "----------------------------------------------------------")
message(STATUS " CMAKE_BUILD_TYPE : ${CMAKE_BUILD_TYPE}")
message(STATUS " MRPT : ${mrpt-nav_VERSION}")
message(STATUS " MVSIM : ${mvsim-simulator_FOUND} (version ${mvsim-simulator_VERSION})")
message(STATUS "")