A C++ CMake project generator (using CMake ToolKit)
Project description
Concept
Python scripts which create C++ CMake projects based on CMTK (used as a git submodule).
See the task board for future updates and features.
Requirements
Binaries:
- CMake 3.16 or later
- git
- python 3.6
- python3-tkinter
Install
pip3 install cmtkgen
Scripts
Each script creates a C++ project according to the information provided by the user.
create_cpp_executable_project.py [project_name]
This scripts generates a CMake project with an executable target. This executable can be installed after being successfully built.
Questions asked to generate the project:
-
Project name (if not provided on command line)
-
Project version (default: 0.1.0)
-
Allowing CMake build-in tree? To allow the CMake configuration of the project directly in the source directory or in one of its sub-directory.
-
Which C++ version do you want to use? (11, 14, 17, 20)
-
Do you want a .gitignore file?
-
Do you want a License file? Which file name? Who are the copyright holders?
-
Do you want a Readme file?Which file name?
-
Do you want a version header file? (a version.hpp file will be created by CMTK during CMake configuration.)
Example of a full executable project named cpp_exec:
cpp_exec/
├── cmake
│ └── cmtk/...
├── include
│ └── cpp_exec
│ └── cpp_exec.hpp
├── src
│ ├── cpp_exec.cpp
│ └── main.cpp
├── CMakeLists.txt
├── cmake_quick_install.cmake
├── .gitignore
├── .gitmodules # For CMTK
├── LICENSE.md
└── README.md
To configure, build and install such a project use [cmake_quick_install.cmake](#About cmake_quick_install.cmake) or execute the following commands:
cmake -S cpp_exec/ -B build
cmake --build build/
cmake --install build/
create_cpp_lib_project.py [project_name]
Questions asked to generate the project:
-
Project name (if not provided on command line)
-
Project version (default: 0.1.0)
-
Allowing CMake build-in tree? To allow the CMake configuration of the project directly in the source directory or in one of its sub-directory.
-
Which C++ version do you want to use? (11, 14, 17, 20)
-
Do you want a .gitignore file?
-
Do you want a License file? Which file name? Who are the copyright holders?
-
Do you want a Readme file?Which file name?
-
Do you want a version header file? (a version.hpp file will be created by CMTK during CMake configuration.)
-
Which type of package-config file do you want for your project, BASIC or VERBOSE? (a package-config.cmake will be created by CMTK during CMake configuration.)
Example of a full executable project named cpp_lib:
cpp_lib/
├── cmake
│ └── cmtk/...
├── example
│ ├── CMakeLists.txt
│ └── cpp_lib_example.cpp
├── include
│ └── cpp_lib
│ └── cpp_lib.hpp
├── src
│ └── cpp_lib.cpp
├── test
│ ├── CMakeLists.txt
│ └── cpp_lib_tests.cpp
├── CMakeLists.txt
├── cmake_quick_install.cmake
├── .gitignore
├── .gitmodules # For CMTK
├── LICENSE.md
└── README.md
To configure, build and install such a project use [cmake_quick_install.cmake](#About cmake_quick_install.cmake) or execute the following commands:
cmake -S cpp_lib/ -B build
cmake --build build/
cmake --install build/
create_cpp_honly_lib_project.py [project_name]
Questions asked to generate the project:
-
Project name (if not provided on command line)
-
Project version (default: 0.1.0)
-
Allowing CMake build-in tree? To allow the CMake configuration of the project directly in the source directory or in one of its sub-directory.
-
Which C++ version do you want to use? (11, 14, 17, 20)
-
Do you want a .gitignore file?
-
Do you want a License file? Which file name? Who are the copyright holders?
-
Do you want a Readme file?Which file name?
-
Do you want a version header file? (a version.hpp file will be created by CMTK during CMake configuration.)
-
Which type of package-config file do you want for your project, BASIC or VERBOSE? (a package-config.cmake will be created by CMTK during CMake configuration.)
Example of a full executable project named cpp_honly:
cpp_honly/
├── cmake
│ └── cmtk/...
├── example
│ ├── CMakeLists.txt
│ └── cpp_honly_example.cpp
├── include
│ └── cpp_honly
│ └── cpp_honly.hpp
├── test
│ ├── CMakeLists.txt
│ └── cpp_honly_tests.cpp
├── CMakeLists.txt
├── cmake_quick_install.cmake
├── .gitignore
├── .gitmodules # For CMTK
├── LICENSE.md
└── README.md
To configure, build and install such a project use [cmake_quick_install.cmake](#About cmake_quick_install.cmake) or execute the following commands:
cmake -S cpp_honly/ -B build
cmake --build build/
cmake --install build/
create_cpp_hello_world.py [project_name]
Questions asked to generate the project:
-
Project name (if not provided on command line)
-
Which C++ version do you want to use? (11, 14, 17, 20)
Example of a full executable project named cpp_hello_world:
cpp_hello_world/
├── cmake
│ └── cmtk/...
├── CMakeLists.txt
├── .gitmodules # For CMTK
├── main.cpp
└── main.hpp
To configure and build such a project execute use the following commands:
cmake -S cpp_hello_world/ -B build
cmake --build build/
About cmake_quick_install.cmake
Executable and library projects have a cmake_quick_install.cmake script. It can be called with CMake like this:
cmake -P cmake_quick_install.cmake
It has optional parameters:
- DIR: The install prefix directory.
- BUILD: The build type. (default: Release)
Some examples:
cmake -P cmake_quick_install.cmake -- DIR ~/local/
cmake -P cmake_quick_install.cmake -- BUILD Debug
cmake -P cmake_quick_install.cmake -- DIR ~/local/ BUILD Debug
License
MIT License © cmtkgen
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cmtkgen-0.9.tar.gz.
File metadata
- Download URL: cmtkgen-0.9.tar.gz
- Upload date:
- Size: 10.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ce6b888cd6f71df46bba928e74129a73ad65d2b59108f8bdbcb15ea7825b3f1
|
|
| MD5 |
b6bd2fea580e32eb388aba5cce809532
|
|
| BLAKE2b-256 |
030ddb45a5041e99fd336a46ce7444cca699a5cec59338ebfdb9edb35a89d98a
|
File details
Details for the file cmtkgen-0.9-py3-none-any.whl.
File metadata
- Download URL: cmtkgen-0.9-py3-none-any.whl
- Upload date:
- Size: 17.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.23.0 setuptools/51.0.0 requests-toolbelt/0.9.1 tqdm/4.46.0 CPython/3.8.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8090d4ff36bedf82bfffac3f144941b7ff83ada3f8ed38e21529736fd5b400b1
|
|
| MD5 |
d5d0c5ac6d03626930c2a0bb0a5d7190
|
|
| BLAKE2b-256 |
a858b0ab8633905570be3e10b0ace22010a9f45666ac7f1d68840566a930f17e
|