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
cmake_minimum_required(VERSION 3.23 FATAL_ERROR) project(Crucible DESCRIPTION "Crucible is an all-in-one framework for building cross-platform applications." LANGUAGES CXX VERSION 0.9.0) list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") set(BUILD_SHARED_LIBS FALSE CACHE BOOL "Build shared libraries instead of static libraries [default: OFF]") set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "Build type (see https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html) [default: RelWithDebInfo]") set(CRUCIBLE_ENABLE_ADDRESS_SANITIZER FALSE CACHE BOOL "Enable AddressSanitizer if supported [default: OFF]") set(CRUCIBLE_ENABLE_COMPILER_WARNINGS TRUE CACHE BOOL "Enable warnings on supported compilers [default: ON]") set(CRUCIBLE_ENABLE_THREAD_SANITIZER FALSE CACHE BOOL "Enable ThreadSanitizer if supported [default: OFF]") set(CRUCIBLE_ENABLE_UNDEFINED_BEHAVIOR_SANITIZER FALSE CACHE BOOL "Enable UndefinedBehaviorSanitizer if supported [default: OFF]") set(CRUCIBLE_BUILD_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/output" CACHE PATH "The directory to place the build output [default: ${PROJECT_BINARY_DIR}/output]") include(CTest) message(NOTICE) message(NOTICE "╭─────────────────────────────────────────╮") message(NOTICE "│ TOOLCHAIN CONFIGURATION │") message(NOTICE "╰─────────────────────────────────────────╯") message(NOTICE) message(NOTICE "C++ Compiler: ${CMAKE_CXX_COMPILER_ID} version ${CMAKE_CXX_COMPILER_VERSION}") message(NOTICE "Build shared libraries: ${BUILD_SHARED_LIBS}") message(NOTICE "Build type: ${CMAKE_BUILD_TYPE}") message(NOTICE) include(CrucibleConfigure) crucible_configure_address_sanitizer() crucible_configure_exception_handling() crucible_configure_language_standards() crucible_configure_optimizations() crucible_configure_output_directories() crucible_configure_preprocessor_definitions() crucible_configure_symbol_export_behavior() crucible_configure_text_encoding() crucible_configure_thread_sanitizer() crucible_configure_undefined_behavior_sanitizer() crucible_configure_warning_level() message(NOTICE) message(NOTICE "╭───────────────────────────────────────╮") message(NOTICE "│ SYSTEM IDENTIFICATION │") message(NOTICE "╰───────────────────────────────────────╯") message(NOTICE) message(NOTICE "Target system: ${CMAKE_SYSTEM_NAME} version ${CMAKE_SYSTEM_VERSION} on ${CMAKE_SYSTEM_PROCESSOR}") message(NOTICE "Host system: ${CMAKE_HOST_SYSTEM_NAME} version ${CMAKE_HOST_SYSTEM_VERSION} on ${CMAKE_HOST_SYSTEM_PROCESSOR}") message(NOTICE) include(CrucibleCheck) crucible_check_target_system_is_64_bit() crucible_check_target_system_is_unix_like() crucible_check_target_system_is_windows_like() crucible_check_target_system_has_dirent_d_namlen() message(NOTICE) message(NOTICE "╭───────────────────────────────────╮") message(NOTICE "│ TARGET DEFINITION │") message(NOTICE "╰───────────────────────────────────╯") message(NOTICE) include(CrucibleAdd) add_subdirectory(executables) add_subdirectory(libraries) message(NOTICE) message(NOTICE "╭──────────────────────────╮") message(NOTICE "│ COMPLETE │") message(NOTICE "╰──────────────────────────╯") message(NOTICE)