Skip to content

Project template for C++ with CMake, Gtest and a build script

License

Notifications You must be signed in to change notification settings

onurozuduru/cpp-project-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cpp-project-template

Project template for c++, includes a build script, example cmake files and googletest setup.

cpp-project-template.gif

Create New Project

create_cpp_project.sh copies the template to the given path and sets project name in cmake file. It is possible to create link to the script under a directory under $PATH, by default $HOME/.local/bin is used.

# Give execute permission
chmod +x create_cpp_project

# Link script under ~/.local/bin for convenience
./create_cpp_project.sh --install

# Create new project
create_cpp_project /path/to/new_project

Template Structure

TemplateProject/
├── .clang-format
├── .gitignore
├── build.sh*
├── CMakeLists.txt
├── exe/
│  ├── CMakeLists.txt
│  ├── include/
│  │  └── logger.h
│  └── source/
│     ├── logger.cpp
│     └── main.cpp
├── libs/
│  ├── CMakeLists.txt
│  └── examplelib/
│     ├── CMakeLists.txt
│     ├── include/
│     │  └── examplelib.h
│     └── source/
│        └── examplelib.cpp
└── test/
   ├── CMakeLists.txt
   └── libs/
      ├── CMakeLists.txt
      └── examplelib/
         └── examplelib_test.cpp

Project Build Script

Each new project includes build.sh script to be able to build with CMake. The script creates a folder named build under the project folder and able pass build type and build with or without tests.

About

Project template for C++ with CMake, Gtest and a build script

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published