This is a project template. Feel free to use & fork it. It contains all pre-configured CMakeLists.txt, so to use it, replace project name with your one in main CmakeLists.txt, and all target and executable names in CI/CD script. Sample program prints a greeting for the first argument.
Run the following commands from the project directory.
- Create CMake cache
cmake -S . -B cmake-build
- Build executable target
cmake --build cmake-build --target cpp_tests
- Build tests target
cmake --build cmake-build --target cpp_tests_tests
- Run executable target
- On Windows:
.\cmake-build\cpp_tests.exe World
- On *nix:
./cmake-build/bin/cpp_tests World
- Run tests
- On Windows:
.\cmake-build\cpp_tests_tests.exe
- On *nix:
./cmake-build/tests/cpp_tests_tests