6/12/2023 0 Comments Modern cmake![]() The test and standalone subprojects include the tools.cmake file which is used to import additional tools on-demand through CMake configuration arguments. cmake -S all -B buildĬmake -build build -target GenerateDocs Additional tools This is useful during development, as it exposes all subprojects to your IDE and avoids redundant builds of the library. The project also includes an all directory that allows building all targets at the same time. To build the documentation locally, you will need Doxygen, jinja2 and Pygments on installed your system. ![]() cmake -S documentation -B build/docĬmake -build build/doc -target GenerateDocs To manually build documentation, call the following command. The documentation is automatically built and published whenever a GitHub Release is created. cmake -S test -B build/testĬmake -build build/test -target fix-format This requires clang-format, cmake-format and pyyaml to be installed on the current system. Use the following commands from the project's root directory to check and fix C++ and CMake source style. To collect code coverage information, run CMake with the -DENABLE_TEST_COVERAGE=1 option. cmake -S test -B build/testĬTEST_OUTPUT_ON_FAILURE = 1 cmake -build build/test -target test # or simply call the executable: Use the following commands from the project's root directory to run the test suite. build/standalone/Greeter -help Build and run test suite Use the following command to build and run the executable target. During development it is usually convenient to build all subprojects at once. 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. ![]() Feel free to replace the License with one suited for your project. Add your project's codecov token to your project's github secrets under CODECOV_TOKENĮventually, you can remove any unused files, such as the standalone directory or irrelevant github workflows for your project.For header-only libraries: see the comments in CMakeLists.txt.Remember to rename the include/greeter directory to use your project's lowercase name and update all relevant #includes accordingly.Capitalization matters here: Greeter means the name of the project, while greeter is used in file names.Replace all occurrences of "Greeter" in the relevant CMakeLists.txt with the name of your project.Automatic documentation and deployment with Doxygen and GitHub Pages. ![]()
0 Comments
Leave a Reply. |