This repository contains a simple script to instantiate a standard CMake project (in C).
The script in this directory (create_project.sh
) will create the following tree:
|-.gitignore
|-code
| |-build.sh
| |-clean.sh
| |-CMakeLists.txt
| |-components
| | |-dummy
| | | |-CMakeLists.txt
| | | |-include
| | | | |-dummy.h
| | | |-priv_include
| | | | |-dummy_priv.h
| | | |-src
| | | | |-dummy.c
| |-include
| | |-test_main.h
| |-run.sh
| |-src
| | |-test_main.c
|-README.md
|-tools
| |-cmake
| | |-extra_warnings.cmake
To build a CMake project, you have to have CMake installed. See CMake Install for more information.
To utilize this repository, you must be in an environment that can run a bash script. This can be done from the default Linux and MacOS terminals.
On Windows, you can run wsl
or bash
to get into the bash environment.
To generate a new CMake project in a new directory my_directory
, you can run the following command:
sh create_project.sh -d my_directory -n my_project
Or, to create a new CMake project in the current directory, you can run the following command:
sh create_project.sh -n my_project
To see the usage of this script, run the following command:
sh create_project.sh -h