Use the following command to build and run the executable target.
cmake -Hstandalone -Bbuild/standalone
+


Setting up a new C++ project usually requires a significant amount of preparation and boilerplate code, even more so for modern C++ projects with tests, executables and continuous integration. This template is the result of learnings from many previous projects and should help reduce the work required to setup up a modern C++ project.
- Use this repo as a template and replace all occurrences of "Greeter" in the relevant CMakeLists.txt with the name of your project
- Replace the source files with your own
- For header-only libraries: see the comments in CMakeLists.txt
- Add your project's codecov token to your project's github secrets under
CODECOV_TOKEN
- Happy coding!
Eventually, you can remove any unused files, such as the standalone directory or irrelevant github workflows for your project. Feel free to replace the License with one suited for your project.
To cleanly separate the library and subproject code, the outer CMakeList.txt
only defines the library itself while the tests and other subprojects are self-contained in their own directories. During development it is usually convenient to build all subprojects at once.
Use the following command to build and run the executable target.
cmake -Hstandalone -Bbuild/standalone
cmake --build build/standalone
./build/standalone/Greeter --help
Use the following commands from the project's root directory to run the test suite.
cmake -Htest -Bbuild/test
cmake --build build/test
@@ -122,7 +122,7 @@ cmake --build build --target GenerateDocs
diff --git a/modules.html b/modules.html
index 1b70401..c44ace8 100644
--- a/modules.html
+++ b/modules.html
@@ -111,7 +111,7 @@
diff --git a/namespacegreeter.html b/namespacegreeter.html
index e650195..93ce645 100644
--- a/namespacegreeter.html
+++ b/namespacegreeter.html
@@ -139,7 +139,7 @@
diff --git a/namespaces.html b/namespaces.html
index d6ad875..708a369 100644
--- a/namespaces.html
+++ b/namespaces.html
@@ -112,7 +112,7 @@
diff --git a/pages.html b/pages.html
index 354c091..f982b90 100644
--- a/pages.html
+++ b/pages.html
@@ -112,7 +112,7 @@