Git Product home page Git Product logo

cpp_cmake_generator's Introduction

CMake Project Generator

A CMake project directory tree generator for c++

Description

This script generates a C/C++ project directory tree ready to go. It provides boilerplates that demonstrate how to link your different modules/application/unit test modules together and with external dependencies.

This script can also generate projects that links to googletest, boost, boost unit test framework and openssl. It provides those who aren't very familiar with CMake syntax with a project directory tree redy to go.

Example`

Inside the script file bootstrap_cpp_project.sh, you can configure the following parameters of your project:

cmake_version=3.0
boost_version=1.59

#Look in the default system installation path.
openssl_path="" 
boost_path="~/Downloads/boost_1_68_0" 
gtest_path="~/Documents/Workspace/googletest/googletest"
gmock_path="~/Workspace/googletest/googlemock"

use_boost=y   #y/n
use_openssl=y #y/n

#If you choose Boost Test, you must set use_boost=y
use_google_test=y  #y/n
use_boost_test=y   #y/n

Execute the script passing the project name as argument:

$ ./bootstrap_cpp_project.sh my_project

This is the directory tree generated

  .my_project
├── app
├── CMakeLists.txt
├── app
|   ├── CMakeLists.txt
|   └── app_template.cpp
├── benchmark
|   ├── CMakeLists.txt
|   └── benchmark_template.cpp
├── build
├── src
|   ├── CMakeLists.txt
|   └── template
|   |   ├── CMakeLists.txt
|   |   ├── module_template.h
|   |   └── module_template.cpp
├── tests
|   ├── CMakeLists.txt
|   └── template
|   |   ├── CMakeLists.txt
|   |   ├── template_boosttest.cpp
|   |   ├── test_noframework_template.cpp
|   |   └── template_gtest.cpp

To build the template poject, execute the following commands in the folder build:

$ cd my_project/build && cmake ../ && make

cpp_cmake_generator's People

Contributors

filipecalasans avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.