-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
56 lines (40 loc) · 1.62 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
################################################################################
# Preamble
cmake_minimum_required(VERSION 3.21)
project(
mechanism_configuration
VERSION 1.0.0
LANGUAGES CXX
)
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING
"Choose the type of build, options are: Debug Release RelWithDebInfo MinSizeRel."
FORCE)
endif()
message(STATUS "CMake build configuration for ${PROJECT_NAME} (${CMAKE_BUILD_TYPE}) ${PROJECT_VERSION}")
################################################################################
# Projet wide setup options
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${PROJECT_SOURCE_DIR}/cmake")
option(OPEN_ATMOS_ENABLE_TESTS "Build the tests" ON)
################################################################################
# Dependencies
include(cmake/dependencies.cmake)
################################################################################
# project source code
add_subdirectory(src)
################################################################################
# Tests
if(PROJECT_IS_TOP_LEVEL AND OPEN_ATMOS_ENABLE_TESTS)
enable_testing()
add_subdirectory(test)
# Copy example folder to use as test data
add_custom_target(copy_example_configs ALL ${CMAKE_COMMAND} -E copy_directory
${CMAKE_CURRENT_SOURCE_DIR}/examples ${CMAKE_BINARY_DIR}/examples)
endif()
################################################################################
# Packaging
# only include packaging if we are the top level project being built
if(PROJECT_IS_TOP_LEVEL)
add_subdirectory(packaging)
endif()