-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
71 lines (58 loc) · 2.43 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
# Copyright (c) 2020 - 2024 Big Ladder Software, LLC.
# See the LICENSE.txt file for additional terms and conditions.
# NOTE: THIS FILE IS AUTO-GENERATED. DO NOT EDIT.
cmake_minimum_required(VERSION 3.10) # required for gtest_discover_tests
project(erin
VERSION 0.0.56
DESCRIPTION "Energy Resilience of Interacting Networks"
LANGUAGES CXX
)
# NOTE: Required for some dependencies to build (e.g., toml11).
set(CMAKE_CXX_STANDARD 20)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
# Set a default build type if none was specified
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Release' as none was specified.")
set(CMAKE_BUILD_TYPE Release CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release"
"MinSizeRel" "RelWithDebInfo")
endif ()
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
include(CMakeDependentOption)
cmake_dependent_option(${PROJECT_NAME}_BUILD_TESTING "Build ${PROJECT_NAME} testing targets" ON "${PROJECT_NAME}_IS_TOP_LEVEL" OFF)
option(${PROJECT_NAME}_COVERAGE "Add ${PROJECT_NAME} coverage reports" OFF)
#cmake_dependent_option(${PROJECT_NAME}_BUILD_EXAMPLES "Build ${PROJECT_NAME} examples" ON "${PROJECT_NAME}_IS_TOP_LEVEL" OFF)
cmake_dependent_option(${PROJECT_NAME}_WARNINGS_AS_ERRORS "Treat warnings in ${PROJECT_NAME} as errors" ON "${PROJECT_NAME}_IS_TOP_LEVEL" OFF)
option(${PROJECT_NAME}_STATIC_LIB "Make ${PROJECT_NAME} a static library" ON)
if (NOT ${PROJECT_NAME}_STATIC_LIB)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif ()
include(build-options-interface)
include(get-git-hash)
message(STATUS "Building ${PROJECT_NAME} ${PROJECT_VERSION} (${PROJECT_GIT_HASH})")
configure_file(
${PROJECT_SOURCE_DIR}/include/erin/version.h.in
${PROJECT_BINARY_DIR}/include/erin/version.h
)
# Set up testing/coverage
if (${PROJECT_NAME}_BUILD_TESTING)
enable_testing()
if (${PROJECT_NAME}_COVERAGE)
set(ENABLE_COVERAGE ON CACHE BOOL "" FORCE)
find_package(codecov)
endif ()
endif ()
# Add subdirectories
add_subdirectory(vendor)
add_subdirectory(src)
add_subdirectory(app)
#if (${PROJECT_NAME}_BUILD_EXAMPLES)
# add_subdirectory(examples)
#endif ()
if (${PROJECT_NAME}_BUILD_TESTING)
add_subdirectory(test)
if (${PROJECT_NAME}_COVERAGE)
coverage_evaluate()
endif ()
endif ()