A simple attempt at making building c++ projects easier.
- Clone the repository.
- Update the name and description of the project in the file
ProjectInfo.mk
.
Alternatively,
- Run the
create-cpp-project
script.
$ bash <(curl -s https://raw.githubusercontent.com/silwalanish/cpp-starter-kit/main/create-cpp-project.sh) -n ${PROJECT_NAME} -p ${PROJECT_PATH}
- Add any build parameters in
BuildOptions.mk
. - Add dependencies in
conanfile.py
.
Install dependencies
$ make setup
Run to compile the project.
$ make compile
Run to link and build the executable. Will create a executable name as {EXECUTABLE_NAME}
set in BuildOptions.mk
.
$ make build
Or just
$ make
Run to execute the project.
$ make run
Runs the unit tests.
$ make test
Run to clean compile artifacts.
$ make clean
\
|--> includes
|--> libs
|--> src
|--> vendor
- Contains the header files for external dependencies.
includes
|--> Dependency1
|--> Dependency2
.
.
.
|--> DependencyN
Note: Use conan to install dependencies if possible.
- Stores the static build of library of external dependencies
libs
|--> Debug
|-> Linux
|-> x86
|-> Dependency1.lib
|-> Dependency2.lib
|-> x64
|-> Dependency1.lib
|-> Dependency2.lib
|-> Win
...
|-> MacOs
...
|--> Release
|-> Linux
...
|-> Win
...
|-> MacOs
...
Note: Use conan to install dependencies if possible.
- Source files for the project.
- If available as a conan package, add the package in
conanfile.py
.
- Add the headers in the
includes
directory.
- Add headers to
includes
directory. - Add prebuilt binaries to
libs
directory. - Update
CCFLAGS
/CFLAGS
inBuildOptions.mk
to link the library.
- Build the dependency following the instruction for the dependency.
- Copy the binaries to
libs
directory. - Update
CCFLAGS
/CFLAGS
inBuildOptions.mk
to link the library. - Copy the headers to
includes
directory.