📦 CCPM - Custom Cmake Package Manager
🧑💻 Are you tired of watching time fade away as CMake recompiles Assimp for the sixth time today just because you had to do a rebuild of your own code?
🖖 Do you have your CMakeLists.txt full of add_subdirectory for code that is not yours?
add_subdirectory(third_party/fmt)
find_package(fmt REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE fmt::fmt)
⚡ No worries, we’ve got the solution right here!
🌊 Flow
🚀 Install the tool
pip install ccpm
📃 Define your dependencies
The below example will install fmt, glfw and glm with custom defines.
Create a simple ccpm.toml in the same folder of main 'CMakeLists.txt' similar to this one:
[[git]]
repo_url = "https://github.com/fmtlib/fmt"
tag = "11.0.2"
defines = ["FMT_TEST=OFF", "FMT_DOC=OFF"]
[[git]]
repo_url = "https://github.com/glfw/glfw"
tag = "3.4"
defines = ["GLFW_BUILD_DOCS=OFF", "GLFW_BUILD_TESTS=OFF", "GLFW_BUILD_EXAMPLES=OFF"]
[[git]]
repo_url = "https://github.com/g-truc/glm"
tag = "1.0.1"
defines = ["GLM_BUILD_TESTS=OFF", "GLM_ENABLE_CXX_20=ON"]
✍️ On your CMake
include(${CMAKE_SOURCE_DIR}/.ccpm/ccpm.cmake) # This resolves modulepaths
add_executable(${AWESOME_TARGET} main.cpp)
# I'm working on simplify this stage but there is many differences between some packages
find_packge(fmt REQUIRED)
target_link_libraries(${AWESOME_TARGET} PRIVATE fmt::fmt)
# Goal syntax
include(${CMAKE_SOURCE_DIR}/.ccpm/ccpm.cmake) # This will include the 'find_packge(fmt REQUIRED)'
target_link_libraries(${AWESOME_TARGET} PRIVATE ${CCPM_LINK_LIBRARIES}) # To include all of them
target_link_libraries(${AWESOME_TARGET} PRIVATE ${CCPM_LIB_fmt}) # For more granularity
🛠️ Donwload, Build and Install packages
ccpm -i # To run download+build+install process (only needed if you change the .toml file)
ccpm -b # Builds the main 'CMakeLists.txt' (by default in debug, add -r for release)
📝 Notes
This script assumes that you have the following commands installed:
- cmake
- git
In the roadmap:
- Other git providers 1
- Add option to choose CMake Generator
- Automatic lib name and target gathering 2
- Zip files
- Others VCS like SVN or Hg
Lectures / Inspiration:
Metadata
Release files for ccpm 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ccpm-0.0.1.tar.gz | 7.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ccpm-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 15.1 kB
Release files / ccpm-0.0.1.tar.gz
| Download URL | ccpm-0.0.1.tar.gz |
|---|---|
| Size | 7.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d01aa728230f6f56db1c6b109e121ee66f37477de54d5ab1546024db5612ada2
|
|
BLAKE2b-256 checksum How to use checksums |
6856ee5a44c75c886841507a0ceae18a72d7c05de5e5fa275d73771d0b4da1bf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|
Release files / ccpm-0.0.1-py3-none-any.whl
| Download URL | ccpm-0.0.1-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3690704e7983f1bb39c47f3de33fc90e0f11ca936ba688d43826ac529fcb5429
|
|
BLAKE2b-256 checksum How to use checksums |
3f6dc1cdd46ad23a08a3c49342b4fbe0e6def188a8ca53c0b888574ba0c31c3a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.1.1 CPython/3.9.20
|