This repository has been archived by the owner on May 28, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
60 lines (51 loc) · 2.1 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
################################################################################
# robot-concepts #
# #
# Copyright (c) 2018, Individual contributors see AUTHORS.md file #
# See AUTHORS.md - All rights reserved. #
# Released under BSD License. See details in LICENSE file #
################################################################################
#
# General configuration
#
cmake_minimum_required(VERSION 3.10.2) # Ubuntu 18
project(robot_concepts VERSION 0.1.0 LANGUAGES C CXX)
# Compile by default in Release
if (NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "Type of build" FORCE)
message(STATUS "Using default build type: ${CMAKE_BUILD_TYPE}")
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel"
"RelWithDebInfo")
endif()
#
# CMake extras
#
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
include(BuildUtils)
include(CheckCXXCompilerFlag)
include(GNUInstallDirs)
# Check that the compiler supports concepts - currently supported only on gcc>=6
check_cxx_compiler_flag("-fconcepts" COMPILER_SUPPORTS_CONCEPTS)
if (NOT COMPILER_SUPPORTS_CONCEPTS)
message(FATAL_ERROR "Compiler in use (${CMAKE_CXX_COMPILER_ID}) does not support C++17 + concepts")
endif()
#
# Output directories
#
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin)
set(CMAKE_INSTALL_MODULES_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
#
# Global cmake vars
#
set(ROBOT_CONCEPTS_NAMESPACE ${PROJECT_NAME}) # target-based configuration
#
# Project subdirectories
#
add_subdirectory(cmake)
add_subdirectory(third_party)
add_subdirectory(robot_concepts)
add_subdirectory(doc)
add_subdirectory(demo)