Skip to main content

clean_cmake_project

python script to generate skeleton for cmake project for c++ https://github.com/FrenchCommando/clean_cmake_project

Dependency

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

Usage

  • directly use the script

or

  • 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)

    or

  • installing the package also adds an entrypoint

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

Structure

  • 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

##Links

  • 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

Contribution

Anything is always welcome

Github

Release files for clean-cmake-project 0.0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clean-cmake-project 0.0.4
File Size Uploaded
clean_cmake_project-0.0.4.tar.gz 4.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clean-cmake-project 0.0.4
File Interpreter ABI Platform
clean_cmake_project-0.0.4-py3-none-any.whl Python 3 none any Details

Total release size: 9.9 kB

Release files / clean_cmake_project-0.0.4.tar.gz

Download URL clean_cmake_project-0.0.4.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
890a3a9ca7d32796d7adff1742f91985040cfdbe2f7cd8387ac3c0632252d12b
BLAKE2b-256 checksum
How to use checksums
dc54e354f07a41f7bebabf7db327b845c002c1696ef5fab1dd69197015bc9e94
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Release files / clean_cmake_project-0.0.4-py3-none-any.whl

Download URL clean_cmake_project-0.0.4-py3-none-any.whl
Size 5.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c8804613a392dacb0677af6d93d1f6eb65de01d7e685696740009ab667ec4943
BLAKE2b-256 checksum
How to use checksums
10ac4c4538ecc20cdd1f7b9198961b35fedc9f0d73eb62d02418c43e6e406806
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.14.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.35.0 CPython/3.7.3

Release history Release notifications | RSS feed

This release

0.0.4 This release

2 release files

0.0.3

2 release files

0.0.2

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page