@@ -10,6 +10,8 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
1010
1111# Options
1212option (ENABLE_TESTING "Build tests" ON )
13+ option (BUILD_APP "Build the demo application" ON )
14+ option (BUILD_DOCS "Enable documentation via Doxygen" ON )
1315
1416# Add custom "Sanitize" build type
1517if (CMAKE_CONFIGURATION_TYPES )
@@ -21,26 +23,18 @@ endif()
2123# Load cmake modules
2224list (APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR} /cmake" )
2325
24- # Warnings, sanitizers, Link Time Optimiziatiion (LTO)
26+ # Warnings, sanitizers, Link Time Optimization (LTO)
2527include (options /LTO)
2628include (options /Warnings)
2729include (options /Sanitizers)
2830
2931# === Libraries ===
30- add_subdirectory (src) # modern_cpp_template ::math
32+ add_subdirectory (src) # modern_cpp_project ::math
3133
3234# === Application ===
33- add_executable (${PROJECT_NAME}
34- src/main.cpp
35- )
36-
37- target_link_libraries (${PROJECT_NAME}
38- PRIVATE math
39- )
40-
41- enable_lto(${PROJECT_NAME} )
42- enable_sanitizers(${PROJECT_NAME} )
43- enable_strict_warnings(${PROJECT_NAME} )
35+ if (BUILD_APP)
36+ add_subdirectory (app) # modern_cpp_project_app
37+ endif ()
4438
4539# === Tests ===
4640if (ENABLE_TESTING)
@@ -49,7 +43,9 @@ if(ENABLE_TESTING)
4943endif ()
5044
5145# === Docs ===
52- include (tools/Doxygen)
46+ if (BUILD_DOCS)
47+ include (tools/Doxygen)
48+ endif ()
5349
5450# === Installation ===
5551include (install /InstallConfig)
0 commit comments