A basic template for C++ projects that use CMake and Clang
build/is where the build files are stored.build/bin/is where the built binaries are stored.src/is where the source code files are stored.tests/is where the unit-test code is stored along with Catch, the unit test framework.build.shis the build script for the main program and the unit tests.run.shis the script that launches the main program or the unit tests.
Don't forget to change the project name and the binary name in the CMakeLists.txt files in both the src/ and the tests/ folders. Look for project_name and bin_name.
The project offers two scripts, one for building and the other for running. Each script has various options that can be displayed on the terminal like so:
./build.sh -h./run.sh -hRunning the build.sh script will build the project with the default parameters which are: debug mode and no unit-tests.
The building process can be customized with the following parameters:
-dor-debugbuild in DEBUG mode.-ror-releasebuild in RELEASE mode.-tor-testbuild tests.-cor-cleanremove the CMakeCache.txt file.-tcor-total-cleanremove the entire build directory.-hor-helpdisplay the help and exit.
Running the run.sh script will simply launch the project generated binary.
The running process can be customized with the following parameters:
-dor-debugrun the program through the GDB debugger.-tor-testrun the unit-tests.-hor-helpdisplay the help and exit.
- Othmane AIT EL CADI - Initial work - dartzon
This project is licensed under the MIT License - see the LICENSE.md file for details
