cmake_minimum_required(VERSION 3.20) # set a default CXX standard for the tools and targets that do not specify them. # If commented, the latest supported standard for your compiler is automatically set. # set(CMAKE_CXX_STANDARD 20) include(FetchContent) if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") cmake_policy(SET CMP0135 NEW) endif() # Add project_options from https://github.com/aminya/project_options # Change the version in the following URL to update the package (watch the releases of the repository for future updates) set(PROJECT_OPTIONS_VERSION "v0.32.1") FetchContent_Declare( _project_options URL https://github.com/aminya/project_options/archive/refs/tags/${PROJECT_OPTIONS_VERSION}.zip) FetchContent_MakeAvailable(_project_options) include(${_project_options_SOURCE_DIR}/Index.cmake) # install vcpkg dependencies: - should be called before defining project() # run_vcpkg() # Set the project name and language project(myproject LANGUAGES CXX C) # Set PCH to be on by default for all non-Developer Mode Builds set(ENABLE_PCH_USER_DEFAULT ON) set(GCC_WARNINGS_DEFAULT "-WBaz") # set(GCC_WARNINGS_USER_DEFAULT "-WFoobar") # Initialize project_options variable related to this project # This overwrites `project_options` and sets `project_warnings` # This also accepts the same arguments as `project_options`. dynamic_project_options( # set the common headers you want to precompile PCH_HEADERS )