Skip to main content

A script to build cmake project for c++ using python

Project description


python script to generate skeleton for cmake project for c++


  • python package stringcase - to convert name formats from/to pascal/snake/constant
  • listed in requirement.txt
  • python 3 - currently working with 3.7


  • directly use the script


  • install the package and call a function

Run the script - Old / Simple version

  • Run the script in cmd
    • The script will prompt a name for the new sub_project
    • Enter the project name and hit Enter
    • You may also enter a path to another folder is you want to create the file in another folder (creates the folder if not exists), otherwise the files will be created in the current working directory and the name of the project is the base name of the current directory
    • (optional) If you also want to build an executable, you can specify a suffix for it (typically "run").

using pip

  • pip install clean_cmake_project

    • import clean_cmake_project.ProjectSkeleton as ccp
    • ccp(name, path)


  • installing the package also adds an entrypoint

    • cmake-python-project
    • that has the same effect as running the script


  • If not already present, a CMakeLists.txt file will be created and filled.
  • googletest will be cloned in /libs/googletest
  • source files are placed in the /src/ folder - with one sub-folder for each sub-project
  • test files are placed in the /tests/ folder - with one sub-folder for each sub-project
  • (optional) source files for executable in /src/*-exe_suffix/ folder


  • The name of the main project is retrieve from the location of the script, it is used for
    • name of the project in the main CMakeList.txt
    • guards for .h files (#define CLEAN_CMAKE_PROJECT_TOTO_H)
  • The main CMakeLists.txt contains links to
    • googletest directory
    • each src and tests sub-directories
  • The CMakeLists.txt from the test folder has a link to the project defined in the src folder
    • the .cpp test contains and include to the .h in the src folder


Anything is always welcome


Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

clean_cmake_project-0.0.4.tar.gz (4.2 kB view hashes)

Uploaded source

Built Distribution

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page