11cmake_minimum_required (VERSION 3.16 )
22
3- # uncomment to set a default CXX standard for the external tools like clang-tidy and cppcheck
4- # and the targets that do not specify a standard.
5- # If not set, the latest supported standard for your compiler is used
6- # You can later set fine-grained standards for each target using `target_compile_features`
7- # Note: linking together projects compiled with different C++ standards may work, but
8- # it is not recommended because of possible issues with ABI
3+ # Not ideal to use this global variable, but necessary to make sure
4+ # that tooling and projects use the same version
95set (CMAKE_CXX_STANDARD 20)
106
117# strongly encouraged to enable this globally to avoid conflicts between
128# -Wpedantic being enabled and -std=c++20 and -std=gnu++20 for example
139# when compiling with PCH enabled
1410set (CMAKE_CXX_EXTENSIONS OFF )
1511
12+
13+ # Note: by default ENABLE_DEVELOPER_MODE is True
14+ # This means that all analysis (sanitizers, static analysis)
15+ # is enabled and all warnings are treated as errors
16+ # if you want to switch this behavior, change TRUE to FALSE
17+ set (ENABLE_DEVELOPER_MODE TRUE CACHE BOOL "Enable 'developer mode'" )
18+
19+ # Change this to false if you want to disable warnings_as_errors in developer mode
20+ set (OPT_WARNINGS_AS_ERRORS_DEVELOPER_DEFAULT TRUE )
21+
1622# Add project_options v0.15.1
1723# https://github.com/cpp-best-practices/project_options
1824include (FetchContent )
@@ -26,7 +32,12 @@ include(${_project_options_SOURCE_DIR}/Index.cmake)
2632# run_vcpkg()
2733
2834# Set the project name and language
29- project (myproject LANGUAGES CXX C )
35+ project (
36+ myproject
37+ VERSION 0.0.1
38+ DESCRIPTION "Starter Project With Best Practices for C++"
39+ HOMEPAGE_URL "https://github.com/cpp-best-practices/cpp_boilerplate_project"
40+ LANGUAGES CXX C )
3041
3142get_property (BUILDING_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
3243if (BUILDING_MULTI_CONFIG)
@@ -79,6 +90,11 @@ dynamic_project_options(
7990
8091target_compile_features (project_options INTERFACE cxx_std_${CMAKE_CXX_STANDARD} )
8192
93+ # configure files based on CMake configuration options
94+ add_subdirectory (configured_files )
95+ target_include_directories (project_options INTERFACE "${CMAKE_BINARY_DIR } " )
96+
97+
8298# Adding the src:
8399add_subdirectory (src )
84100
0 commit comments