CPGen
C++ project generator
Loading...
Searching...
No Matches
Config.hpp
Go to the documentation of this file.
1#pragma once
2
10#include <cstdint>
11#include <optional>
12#include <string>
13#include <vector>
14
19enum class TargetType : std::uint8_t {
20 Library,
22 Test,
23};
24
29enum class CppStandard : std::uint8_t {
30 Cpp17,
31 Cpp20,
32 Cpp23,
33};
34
42 bool has_git = false;
43 bool clang_tidy = false;
45 false;
46
49 std::optional<std::string> clang_format_preset;
50};
51
60 std::string path;
61 std::string
65 std::vector<std::string> modules;
67 std::vector<TargetType> targets;
69};
CppStandard
Selects the C++ language standard to pass to the compiler.
Definition Config.hpp:29
@ Cpp23
ISO C++23 (-std=c++23 / CMAKE_CXX_STANDARD 23).
@ Cpp20
ISO C++20 (-std=c++20 / CMAKE_CXX_STANDARD 20). Default.
@ Cpp17
ISO C++17 (-std=c++17 / CMAKE_CXX_STANDARD 17).
TargetType
Describes the CMake target kind to generate for a build target.
Definition Config.hpp:19
@ Test
A test executable wired into CTest via a testing framework.
@ Executable
A standalone executable target (add_executable).
@ Library
A static or shared library target (add_library).
Fully parsed project configuration produced by CLI::parse.
Definition Config.hpp:59
std::vector< std::string > modules
Definition Config.hpp:65
std::string name
Project name (used as the CMake project name and directory).
Definition Config.hpp:62
std::vector< TargetType > targets
Build target kinds to generate.
Definition Config.hpp:67
ToolingConfig tooling
Optional tooling configuration.
Definition Config.hpp:68
std::string path
Absolute path to the generation directory.
Definition Config.hpp:60
CppStandard standard
C++ language standard. Defaults to C++20.
Definition Config.hpp:63
Groups all optional tooling flags that can be enabled for a project.
Definition Config.hpp:41
bool clang_format
Generate a .clang-format configuration file.
Definition Config.hpp:44
bool clang_tidy
Generate a .clang-tidy configuration file.
Definition Config.hpp:43
bool has_git
Initialise a Git repository in the project root.
Definition Config.hpp:42
std::optional< std::string > clang_format_preset
Definition Config.hpp:49