This repository has been archived by the owner on Aug 11, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
95 lines (80 loc) · 3.33 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
#
# Copyright @ 2019 Audi AG. All rights reserved.
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
#
# If it is not possible or desirable to put the notice in a particular file, then
# You may include the notice in a location (such as a LICENSE file in a
# relevant directory) where a recipient would be likely to look for such a notice.
#
# You may add additional accurate notices of copyright ownership.
#
cmake_minimum_required(VERSION 3.5 FATAL_ERROR)
cmake_policy(SET CMP0011 NEW)
# Disable extensions here and require the chosen CMAKE_CXX_STANDARD (coming from Conan)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT CMAKE_CXX_STANDARD)
message(WARNING "CMAKE_CXX_STANDARD not found, setting it to 14")
set(CMAKE_CXX_STANDARD "14")
elseif(CMAKE_CXX_STANDARD LESS 14)
message(FATAL_ERROR "CMAKE_CXX_STANDARD >= 14 required")
endif()
option(fep_controller_cmake_enable_tests "Enable tests - requires googletest (default: ON)" ON)
project(fep_controller-library VERSION 1.1.1)
set(FEP_CONTROLLER_VERSION_MAJOR ${PROJECT_VERSION_MAJOR})
set(FEP_CONTROLLER_VERSION_MINOR ${PROJECT_VERSION_MINOR})
set(FEP_CONTROLLER_VERSION_PATCH ${PROJECT_VERSION_PATCH})
set(FEP_CONTROLLER_LIB_BUILD true)
# Enable strict compiler warnings
if(WIN32)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /wd4100 /wd4251 /wd4505 /wd4290")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wno-unknown-pragmas -Wno-reorder")
endif()
if(CONAN_COMPILER)
message(STATUS "Including Conan build info")
if ( EXISTS ${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo.cmake)
elseif ( EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../conanbuildinfo.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/../conanbuildinfo.cmake)
elseif ( EXISTS ${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo_multi.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/conanbuildinfo_multi.cmake)
elseif ( EXISTS ${CMAKE_CURRENT_BINARY_DIR}/../conanbuildinfo_multi.cmake)
include(${CMAKE_CURRENT_BINARY_DIR}/../conanbuildinfo_multi.cmake)
else()
message(FATAL_ERROR "Conan build info can't be found.")
endif()
if(CORTEX_WORKSPACE)
conan_basic_setup(TARGETS)
else()
conan_basic_setup(TARGETS NO_OUTPUT_DIRS)
endif()
set(gtest_search_mode CONFIG)
endif()
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
add_subdirectory(src)
if (fep_controller_cmake_enable_tests)
enable_testing()
add_subdirectory(test)
endif()
configure_file(fep_controller-config.cmake.in ${CMAKE_BINARY_DIR}/fep_controller-config.cmake @ONLY)
install(FILES ${CMAKE_BINARY_DIR}/fep_controller-config.cmake DESTINATION .)
# Create version config
include(CMakePackageConfigHelpers)
write_basic_package_version_file(${CMAKE_CURRENT_BINARY_DIR}/fep_controller-config-version.cmake
COMPATIBILITY AnyNewerVersion)
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/fep_controller-config-version.cmake DESTINATION .)
# install content from include directory
install(
DIRECTORY
include
DESTINATION
./
FILES_MATCHING PATTERN
"*.h"
)
install(FILES doc/extern/changelog.md
DESTINATION doc)