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-projectscript.
$ 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 setupRun to compile the project.
$ make compileRun to link and build the executable. Will create a executable name as {EXECUTABLE_NAME} set in BuildOptions.mk.
$ make buildOr just
$ makeRun to execute the project.
$ make runRuns the unit tests.
$ make testRun 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
includesdirectory.
- Add headers to
includesdirectory. - Add prebuilt binaries to
libsdirectory. - Update
CCFLAGS/CFLAGSinBuildOptions.mkto link the library.
- Build the dependency following the instruction for the dependency.
- Copy the binaries to
libsdirectory. - Update
CCFLAGS/CFLAGSinBuildOptions.mkto link the library. - Copy the headers to
includesdirectory.