-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
86 lines (67 loc) · 2.76 KB
/
Copy pathCMakeLists.txt
File metadata and controls
86 lines (67 loc) · 2.76 KB
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
# Authors: see AUTHORS.md at project root.
# CopyPolicy: released under the terms of the LGPLv2.1, see LICENSE at project root.
# URL: https://github.com/asrob-uc3m/robotDevastation
cmake_minimum_required(VERSION 3.12)
project(robotDevastation LANGUAGES CXX)
if(MSVC)
message(STATUS "Running on windows")
set(CMAKE_DEBUG_POSTFIX "d")
endif()
# Let the user specify a configuration (only single-config generators).
if(NOT CMAKE_CONFIGURATION_TYPES)
# Possible values.
set(_configurations Debug Release MinSizeRel RelWithDebInfo)
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${_configurations})
foreach(_conf ${_configurations})
set(_conf_string "${_conf_string} ${_conf}")
endforeach()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY HELPSTRING
"Choose the type of build, options are:${_conf_string}")
if(NOT CMAKE_BUILD_TYPE)
# Encourage the user to specify build type.
message(STATUS "Setting build type to 'Release' as none was specified.")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY VALUE Release)
endif()
endif()
# Pick up our CMake modules.
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake
${CMAKE_SOURCE_DIR}/cmake/modules
${CMAKE_SOURCE_DIR}/cmake/find-modules)
# Find project's hard dependencies.
find_package(YCM 0.11 REQUIRED)
find_package(ASROB_YARP_DEVICES REQUIRED)
find_package(YARP 3.5 REQUIRED COMPONENTS os dev sig)
find_package(SDL2 REQUIRED)
find_package(SDL2_image REQUIRED)
find_package(SDL2_mixer REQUIRED)
find_package(SDL2_ttf REQUIRED)
find_package(ZBar REQUIRED)
# Find project's soft dependencies.
find_package(Doxygen QUIET)
find_package(GTestSources 1.8 QUIET)
# Standard installation directories.
include(GNUInstallDirs)
# Control where libraries and executables are placed during the build.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR})
option(ENABLE_coverage "Choose if you want to enable coverage" OFF)
if(ENABLE_coverage)
# List supported compilers.
if(CMAKE_COMPILER_IS_GNUCXX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
endif()
endif()
# let CMake organize projects in folders (in IDEs that support this).
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Create targets if specific requirements are satisfied.
include(CMakeDependentOption)
# Acknowledge this is a CTest-friendly project.
enable_testing()
# Add main contents.
add_subdirectory(share)
add_subdirectory(src)
add_subdirectory(tests)
add_subdirectory(doc)
# Uninstall target.
include(AddUninstallTarget)