This is a project template. Feel free to use it. It contains all pre-configured CMakeLists.txt, so to use it, just replace project name with your in main CmakeLists.txt, and all target and executable names in CI/CD script.
Run following commands from project directory.
- Create CMake cache
cmake -S . -B cmake-build
- Build main target
cmake --build cmake-build --target cpp_tests
- Build tests target
cmake --build cmake-build --target cpp_tests_tests
- Run main target
- On Windows:
.\cmake-build\bin\cpp_tests.exe || .\cmake-build\bin\Debug\cpp_tests.exe
- On POSIX:
.\cmake-build\bin\cpp_tests
- Run tests
- On Windows:
.\cmake-build\bin\cpp_tests_tests.exe || .\cmake-build\bin\Debug\cpp_tests_tests.exe
- On POSIX:
.\cmake-build\bin\cpp_tests_tests