qcdx 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- qcdx-0.1.0/.github/actions/pk-setup/action.yml +157 -0
- qcdx-0.1.0/.gitignore +29 -0
- qcdx-0.1.0/CMakeLists.txt +53 -0
- qcdx-0.1.0/LICENSE +21 -0
- qcdx-0.1.0/PKG-INFO +298 -0
- qcdx-0.1.0/README.md +270 -0
- qcdx-0.1.0/cmake/QCDXConfig.cmake +17 -0
- qcdx-0.1.0/cmake/QCDXConfigVersion.cmake +46 -0
- qcdx-0.1.0/cmake/projectkit/ApplicationCreator.cmake +262 -0
- qcdx-0.1.0/cmake/projectkit/CompilerWarnings.cmake +54 -0
- qcdx-0.1.0/cmake/projectkit/ConanBuildDir.cmake +84 -0
- qcdx-0.1.0/cmake/projectkit/Dependencies.cmake +601 -0
- qcdx-0.1.0/cmake/projectkit/FileCollection.cmake +115 -0
- qcdx-0.1.0/cmake/projectkit/HostTools.cmake +74 -0
- qcdx-0.1.0/cmake/projectkit/LibraryCreator.cmake +561 -0
- qcdx-0.1.0/cmake/projectkit/Packaging.cmake +291 -0
- qcdx-0.1.0/cmake/projectkit/ProjectKit.cmake +21 -0
- qcdx-0.1.0/cmake/projectkit/ProjectOptions.cmake +250 -0
- qcdx-0.1.0/cmake/projectkit/ProjectSetup.cmake +218 -0
- qcdx-0.1.0/cmake/projectkit/StaticAnalysis.cmake +159 -0
- qcdx-0.1.0/cmake/projectkit/TestCreator.cmake +146 -0
- qcdx-0.1.0/cmake/projectkit/ToolCreator.cmake +139 -0
- qcdx-0.1.0/cmake/projectkit/Tooling.cmake +150 -0
- qcdx-0.1.0/cmake/projectkit/VERSION +1 -0
- qcdx-0.1.0/cmake/projectkit/docs/ANALYSER_LAUNCHER.md +154 -0
- qcdx-0.1.0/cmake/projectkit/docs/PACKAGE.md +257 -0
- qcdx-0.1.0/cmake/projectkit/docs/PK.md +254 -0
- qcdx-0.1.0/cmake/projectkit/docs/PK_DEP.md +430 -0
- qcdx-0.1.0/cmake/projectkit/docs/RELEASE.md +194 -0
- qcdx-0.1.0/cmake/projectkit/docs/VERIFY.md +312 -0
- qcdx-0.1.0/cmake/projectkit/scripts/analyser_launcher.py +65 -0
- qcdx-0.1.0/cmake/projectkit/scripts/helpers/pk/deps.py +1534 -0
- qcdx-0.1.0/cmake/projectkit/scripts/helpers/pk/presets.cmake +142 -0
- qcdx-0.1.0/cmake/projectkit/scripts/pklib/__init__.py +0 -0
- qcdx-0.1.0/cmake/projectkit/scripts/pklib/bootstrap.py +289 -0
- qcdx-0.1.0/cmake/projectkit/scripts/pklib/common.py +472 -0
- qcdx-0.1.0/cmake/projectkit/scripts/pklib/package.py +268 -0
- qcdx-0.1.0/cmake/projectkit/scripts/pklib/pk.py +1750 -0
- qcdx-0.1.0/cmake/projectkit/scripts/pklib/release.py +928 -0
- qcdx-0.1.0/cmake/projectkit/scripts/pklib/targets.py +117 -0
- qcdx-0.1.0/cmake/projectkit/scripts/pklib/verify.py +209 -0
- qcdx-0.1.0/cmake/projectkit/scripts/pklib/verify_base.py +428 -0
- qcdx-0.1.0/cmake/projectkit/templates/PackageConfig.cmake.in +7 -0
- qcdx-0.1.0/cmake/projectkit/templates/pkgconfig.pc.in +11 -0
- qcdx-0.1.0/cmake/projectkit/test_package/CMakeLists.txt +24 -0
- qcdx-0.1.0/cmake/projectkit/test_package/conanfile.py +42 -0
- qcdx-0.1.0/cmake/projectkit/test_package/src/example.cpp +1 -0
- qcdx-0.1.0/conan/test_package/CMakeLists.txt +10 -0
- qcdx-0.1.0/conan/test_package/conanfile.py +20 -0
- qcdx-0.1.0/conanfile.py +54 -0
- qcdx-0.1.0/docs/BUILDING.md +225 -0
- qcdx-0.1.0/docs/FROM_ZERO_TO_PROJECT.md +443 -0
- qcdx-0.1.0/pyproject.toml +88 -0
- qcdx-0.1.0/scripts/bootstrap.py +10 -0
- qcdx-0.1.0/scripts/package.py +10 -0
- qcdx-0.1.0/scripts/pk.py +10 -0
- qcdx-0.1.0/scripts/release.py +10 -0
- qcdx-0.1.0/scripts/verify.py +10 -0
- qcdx-0.1.0/src/qcdx/__init__.py +5 -0
- qcdx-0.1.0/src/qcdx/__main__.py +5 -0
- qcdx-0.1.0/src/qcdx/_commit.py +1 -0
- qcdx-0.1.0/src/qcdx/cli.py +105 -0
- qcdx-0.1.0/src/qcdx/new.py +224 -0
- qcdx-0.1.0/src/qcdx/resources.py +131 -0
- qcdx-0.1.0/template/.clang-format +27 -0
- qcdx-0.1.0/template/.clang-tidy +26 -0
- qcdx-0.1.0/template/.clangd +6 -0
- qcdx-0.1.0/template/.gitattributes +1 -0
- qcdx-0.1.0/template/.github/workflows/release.yml +241 -0
- qcdx-0.1.0/template/.github/workflows/verify.yml +74 -0
- qcdx-0.1.0/template/.gitignore +168 -0
- qcdx-0.1.0/template/CMakeLists.txt +53 -0
- qcdx-0.1.0/template/CMakePresets.json +593 -0
- qcdx-0.1.0/template/README.md +56 -0
- qcdx-0.1.0/template/apps/CMakeLists.txt +4 -0
- qcdx-0.1.0/template/apps/qcdx/main.cpp +8 -0
- qcdx-0.1.0/template/cmake/qcdxConfig.cmake.in +38 -0
- qcdx-0.1.0/template/cmake/toolchains/aarch64-linux-gnu.cmake +40 -0
- qcdx-0.1.0/template/cmake/toolchains/aarch64-mingw-llvm-w64.cmake +28 -0
- qcdx-0.1.0/template/cmake/toolchains/x86_64-linux-gnu.cmake +20 -0
- qcdx-0.1.0/template/cmake/toolchains/x86_64-mingw-w64.cmake +20 -0
- qcdx-0.1.0/template/conan.lock +11 -0
- qcdx-0.1.0/template/conanfile.py +142 -0
- qcdx-0.1.0/template/deps.json +25 -0
- qcdx-0.1.0/template/include/qcdx/core.hpp +9 -0
- qcdx-0.1.0/template/profiles/aarch64-linux-gnu +43 -0
- qcdx-0.1.0/template/profiles/aarch64-mingw-llvm-w64 +42 -0
- qcdx-0.1.0/template/profiles/ci-linux-armv8 +19 -0
- qcdx-0.1.0/template/profiles/ci-linux-x86_64 +19 -0
- qcdx-0.1.0/template/profiles/ci-macos-armv8 +17 -0
- qcdx-0.1.0/template/profiles/ci-macos-x86_64 +17 -0
- qcdx-0.1.0/template/profiles/ci-windows-clang64 +12 -0
- qcdx-0.1.0/template/profiles/ci-windows-clangarm64 +12 -0
- qcdx-0.1.0/template/profiles/ci-windows-ucrt64 +12 -0
- qcdx-0.1.0/template/profiles/native +32 -0
- qcdx-0.1.0/template/profiles/x86_64-linux-gnu +43 -0
- qcdx-0.1.0/template/profiles/x86_64-mingw-w64 +44 -0
- qcdx-0.1.0/template/scripts/helpers/package/package.conf +3 -0
- qcdx-0.1.0/template/scripts/helpers/release/release.conf +99 -0
- qcdx-0.1.0/template/scripts/helpers/verify/consumer.cpp +7 -0
- qcdx-0.1.0/template/scripts/helpers/verify/verify.conf +1 -0
- qcdx-0.1.0/template/src/CMakeLists.txt +5 -0
- qcdx-0.1.0/template/src/qcdx/core.cpp +13 -0
- qcdx-0.1.0/template/tests/CMakeLists.txt +4 -0
- qcdx-0.1.0/template/tests/qcdx/tests_core.cpp +10 -0
- qcdx-0.1.0/template/tools/CMakeLists.txt +4 -0
- qcdx-0.1.0/template/tools/codegen.cpp +137 -0
- qcdx-0.1.0/tests/conftest.py +29 -0
- qcdx-0.1.0/tests/test_cli.py +41 -0
- qcdx-0.1.0/tests/test_layout.py +57 -0
- qcdx-0.1.0/tests/test_new.py +85 -0
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
name: pk-setup
|
|
2
|
+
description: >-
|
|
3
|
+
Toolchain, Conan and the Conan cache for a verify/release target. Used by
|
|
4
|
+
verify.yml and release.yml to only have to set up target once in one place.
|
|
5
|
+
|
|
6
|
+
inputs:
|
|
7
|
+
target:
|
|
8
|
+
description: A target name from cmake/projectkit/scripts/pklib/targets.py.
|
|
9
|
+
required: true
|
|
10
|
+
msystem:
|
|
11
|
+
description: MSYS2 environment (UCRT64, CLANG64, CLANGARM64), Windows only.
|
|
12
|
+
default: ''
|
|
13
|
+
cache:
|
|
14
|
+
description: "'save' restores & saves Conan cache, 'restore' doesn't save."
|
|
15
|
+
default: save
|
|
16
|
+
conan-version:
|
|
17
|
+
default: '2.33.0'
|
|
18
|
+
llvm-mingw-tag:
|
|
19
|
+
default: '20260616'
|
|
20
|
+
llvm-mingw-asset:
|
|
21
|
+
# Linux x86_64 UCRT build of the pinned release.
|
|
22
|
+
default: llvm-mingw-20260616-ucrt-ubuntu-22.04-x86_64.tar.xz
|
|
23
|
+
llvm-mingw-sha256:
|
|
24
|
+
default: 534b92e067b22a6b4441f48ae9240a3341b17825d04d577eab0cf85c44b4deda
|
|
25
|
+
|
|
26
|
+
runs:
|
|
27
|
+
using: composite
|
|
28
|
+
steps:
|
|
29
|
+
# -------------------------------------------------------------------------
|
|
30
|
+
# Linux and macOS
|
|
31
|
+
# -------------------------------------------------------------------------
|
|
32
|
+
|
|
33
|
+
- if: runner.os != 'Windows'
|
|
34
|
+
uses: lukka/get-cmake@fffaaafeea488556c2c12dad60690008bc1caacb # v4.4.2
|
|
35
|
+
|
|
36
|
+
- if: runner.os != 'Windows'
|
|
37
|
+
uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
|
|
38
|
+
with:
|
|
39
|
+
python-version: '3.12'
|
|
40
|
+
|
|
41
|
+
- name: Install Conan
|
|
42
|
+
if: runner.os != 'Windows'
|
|
43
|
+
shell: bash
|
|
44
|
+
run: python -m pip install --disable-pip-version-check "conan==${{ inputs.conan-version }}"
|
|
45
|
+
|
|
46
|
+
# Conan only accepts compiler.cstd=23 from GCC 14. apt should only run when
|
|
47
|
+
# something is missing.
|
|
48
|
+
- name: Install Linux packages
|
|
49
|
+
if: runner.os == 'Linux'
|
|
50
|
+
shell: bash
|
|
51
|
+
env:
|
|
52
|
+
TARGET: ${{ inputs.target }}
|
|
53
|
+
run: |
|
|
54
|
+
packages=()
|
|
55
|
+
command -v g++-14 >/dev/null || packages+=(g++-14)
|
|
56
|
+
case "$TARGET" in
|
|
57
|
+
cross-x86_64-mingw-w64) packages+=(g++-mingw-w64-x86-64) ;;
|
|
58
|
+
cross-aarch64-linux-gnu) command -v aarch64-linux-gnu-gcc >/dev/null || packages+=(g++-aarch64-linux-gnu) ;;
|
|
59
|
+
cross-x86_64-linux-gnu) command -v x86_64-linux-gnu-gcc >/dev/null || packages+=(g++-x86-64-linux-gnu) ;;
|
|
60
|
+
esac
|
|
61
|
+
if [ ${#packages[@]} -gt 0 ]; then
|
|
62
|
+
sudo apt-get update -qq
|
|
63
|
+
sudo apt-get install -y -qq --no-install-recommends "${packages[@]}"
|
|
64
|
+
fi
|
|
65
|
+
if [ "$TARGET" = cross-x86_64-mingw-w64 ]; then
|
|
66
|
+
sudo update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
|
|
67
|
+
sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
|
|
68
|
+
fi
|
|
69
|
+
echo "CC=gcc-14" >> "$GITHUB_ENV"
|
|
70
|
+
echo "CXX=g++-14" >> "$GITHUB_ENV"
|
|
71
|
+
|
|
72
|
+
- name: Install llvm-mingw
|
|
73
|
+
if: inputs.target == 'cross-aarch64-mingw-llvm-w64'
|
|
74
|
+
shell: bash
|
|
75
|
+
env:
|
|
76
|
+
TAG: ${{ inputs.llvm-mingw-tag }}
|
|
77
|
+
ASSET: ${{ inputs.llvm-mingw-asset }}
|
|
78
|
+
SHA256: ${{ inputs.llvm-mingw-sha256 }}
|
|
79
|
+
run: |
|
|
80
|
+
archive="$RUNNER_TEMP/$ASSET"
|
|
81
|
+
curl -fsSL -o "$archive" "https://github.com/mstorsjo/llvm-mingw/releases/download/${TAG}/${ASSET}"
|
|
82
|
+
echo "${SHA256} ${archive}" | sha256sum -c -
|
|
83
|
+
mkdir -p "$RUNNER_TEMP/llvm-mingw"
|
|
84
|
+
tar -xJf "$archive" -C "$RUNNER_TEMP/llvm-mingw" --strip-components=1
|
|
85
|
+
rm -f "$archive"
|
|
86
|
+
echo "$RUNNER_TEMP/llvm-mingw/bin" >> "$GITHUB_PATH"
|
|
87
|
+
|
|
88
|
+
- name: Point Conan at the runner temp directory
|
|
89
|
+
if: runner.os != 'Windows'
|
|
90
|
+
shell: bash
|
|
91
|
+
run: echo "CONAN_HOME=$RUNNER_TEMP/conan2" >> "$GITHUB_ENV"
|
|
92
|
+
|
|
93
|
+
# -------------------------------------------------------------------------
|
|
94
|
+
# Windows (MSYS2)
|
|
95
|
+
# -------------------------------------------------------------------------
|
|
96
|
+
|
|
97
|
+
- if: runner.os == 'Windows'
|
|
98
|
+
uses: msys2/setup-msys2@66cd2cce69caa17b53920067426061ca1de3a884 # v2.32.0
|
|
99
|
+
with:
|
|
100
|
+
msystem: ${{ inputs.msystem }}
|
|
101
|
+
update: true
|
|
102
|
+
install: git
|
|
103
|
+
pacboy: >-
|
|
104
|
+
toolchain:p
|
|
105
|
+
cmake:p
|
|
106
|
+
ninja:p
|
|
107
|
+
python-pip:p
|
|
108
|
+
pkgconf:p
|
|
109
|
+
|
|
110
|
+
# Visual Studio is installed on the runner used, Conan prefers
|
|
111
|
+
# MSVC on Windows, CC/CXX override it.
|
|
112
|
+
- name: Select the MSYS2 compiler
|
|
113
|
+
if: runner.os == 'Windows'
|
|
114
|
+
shell: pwsh
|
|
115
|
+
env:
|
|
116
|
+
MSYSTEM_NAME: ${{ inputs.msystem }}
|
|
117
|
+
run: |
|
|
118
|
+
if ($env:MSYSTEM_NAME -like 'CLANG*') { $cc = 'clang'; $cxx = 'clang++' } else { $cc = 'gcc'; $cxx = 'g++' }
|
|
119
|
+
"CC=$cc" >> $env:GITHUB_ENV
|
|
120
|
+
"CXX=$cxx" >> $env:GITHUB_ENV
|
|
121
|
+
"CONAN_HOME=$env:RUNNER_TEMP\conan2" >> $env:GITHUB_ENV
|
|
122
|
+
|
|
123
|
+
- name: Install Conan
|
|
124
|
+
if: runner.os == 'Windows'
|
|
125
|
+
shell: msys2 {0}
|
|
126
|
+
run: python -m pip install --disable-pip-version-check --break-system-packages "conan==${{ inputs.conan-version }}"
|
|
127
|
+
|
|
128
|
+
# -------------------------------------------------------------------------
|
|
129
|
+
# Conan cache
|
|
130
|
+
# -------------------------------------------------------------------------
|
|
131
|
+
|
|
132
|
+
# The key is shared with verify.yml, and caches saved on main can be read
|
|
133
|
+
# from every branch and tag: release runs will reuse verify's packages,
|
|
134
|
+
# NEVER storing a wasteful second copy.
|
|
135
|
+
- if: inputs.cache == 'save'
|
|
136
|
+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
137
|
+
with:
|
|
138
|
+
path: ${{ runner.temp }}/conan2/p
|
|
139
|
+
key: conan-${{ inputs.target }}-${{ hashFiles('conanfile.py', 'deps.json', 'conan.lock', 'profiles/**') }}
|
|
140
|
+
restore-keys: conan-${{ inputs.target }}-
|
|
141
|
+
|
|
142
|
+
- if: inputs.cache == 'restore'
|
|
143
|
+
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
|
144
|
+
with:
|
|
145
|
+
path: ${{ runner.temp }}/conan2/p
|
|
146
|
+
key: conan-${{ inputs.target }}-${{ hashFiles('conanfile.py', 'deps.json', 'conan.lock', 'profiles/**') }}
|
|
147
|
+
restore-keys: conan-${{ inputs.target }}-
|
|
148
|
+
|
|
149
|
+
- name: Detect the default Conan profile
|
|
150
|
+
if: runner.os != 'Windows'
|
|
151
|
+
shell: bash
|
|
152
|
+
run: conan profile detect --force
|
|
153
|
+
|
|
154
|
+
- name: Detect the default Conan profile
|
|
155
|
+
if: runner.os == 'Windows'
|
|
156
|
+
shell: msys2 {0}
|
|
157
|
+
run: conan profile detect --force
|
qcdx-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# QCDX package repository. template/ has its own .gitignore, the one every new
|
|
2
|
+
# project starts with.
|
|
3
|
+
|
|
4
|
+
# Python
|
|
5
|
+
__pycache__/
|
|
6
|
+
*.py[cod]
|
|
7
|
+
.venv/
|
|
8
|
+
venv/
|
|
9
|
+
dist/
|
|
10
|
+
*.egg-info/
|
|
11
|
+
.pytest_cache/
|
|
12
|
+
.ruff_cache/
|
|
13
|
+
.mypy_cache/
|
|
14
|
+
|
|
15
|
+
# Build output (python -m build, the zipapp, CMake checks)
|
|
16
|
+
build/
|
|
17
|
+
stage/
|
|
18
|
+
|
|
19
|
+
# Editors and OS
|
|
20
|
+
.vscode/
|
|
21
|
+
.idea/
|
|
22
|
+
.DS_Store
|
|
23
|
+
Thumbs.db
|
|
24
|
+
|
|
25
|
+
# Written by the release workflow (the commit a build came from)
|
|
26
|
+
src/qcdx/_commit.py
|
|
27
|
+
|
|
28
|
+
# conan create (test_package)
|
|
29
|
+
CMakeUserPresets.json
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# The QCDX kit (ProjectKit) as a CMake package. Projects made with 'pk new'
|
|
2
|
+
# vendor the kit and never need this; it is for using ProjectKit modules in an
|
|
3
|
+
# existing CMake project:
|
|
4
|
+
#
|
|
5
|
+
# cmake -S . -B build && cmake --install build --prefix /usr/local
|
|
6
|
+
# find_package(QCDX 0.1 REQUIRED) # in the consuming project
|
|
7
|
+
# include(ProjectKit)
|
|
8
|
+
#
|
|
9
|
+
# or without installing anything (CMake 3.24+):
|
|
10
|
+
#
|
|
11
|
+
# include(FetchContent)
|
|
12
|
+
# FetchContent_Declare(qcdx URL <release qcdx-X.Y.Z.tar.gz> URL_HASH SHA256=...)
|
|
13
|
+
# FetchContent_MakeAvailable(qcdx)
|
|
14
|
+
# find_package(QCDX 0.1 REQUIRED)
|
|
15
|
+
# include(ProjectKit)
|
|
16
|
+
|
|
17
|
+
cmake_minimum_required(VERSION 3.25)
|
|
18
|
+
|
|
19
|
+
file(STRINGS "${CMAKE_CURRENT_LIST_DIR}/cmake/projectkit/VERSION" _qcdx_version LIMIT_COUNT 1)
|
|
20
|
+
|
|
21
|
+
project(QCDX
|
|
22
|
+
VERSION ${_qcdx_version}
|
|
23
|
+
DESCRIPTION "ProjectKit: CMake modules and scripts for C and C++ projects"
|
|
24
|
+
HOMEPAGE_URL "https://github.com/cooldood155/QCDX"
|
|
25
|
+
LANGUAGES NONE)
|
|
26
|
+
|
|
27
|
+
# Added by FetchContent or add_subdirectory: point find_package(QCDX) at this
|
|
28
|
+
# tree. QCDX_DIR is what find_package checks first; the redirect file serves
|
|
29
|
+
# FetchContent_Declare(... FIND_PACKAGE_ARGS) and OVERRIDE_FIND_PACKAGE.
|
|
30
|
+
if(NOT PROJECT_IS_TOP_LEVEL)
|
|
31
|
+
set(QCDX_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake" CACHE PATH "QCDX package configuration" FORCE)
|
|
32
|
+
if(CMAKE_FIND_PACKAGE_REDIRECTS_DIR)
|
|
33
|
+
file(WRITE "${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/qcdx-extra.cmake"
|
|
34
|
+
"include(\"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QCDXConfig.cmake\")\n")
|
|
35
|
+
file(WRITE "${CMAKE_FIND_PACKAGE_REDIRECTS_DIR}/qcdx-extra-version.cmake"
|
|
36
|
+
"include(\"${CMAKE_CURRENT_SOURCE_DIR}/cmake/QCDXConfigVersion.cmake\")\n")
|
|
37
|
+
endif()
|
|
38
|
+
return()
|
|
39
|
+
endif()
|
|
40
|
+
|
|
41
|
+
# <prefix>/share/qcdx/cmake/ is on find_package's default search path.
|
|
42
|
+
# GNUInstallDirs is not used: it needs a language enabled, only share/ matters.
|
|
43
|
+
set(QCDX_INSTALL_CMAKEDIR "share/qcdx/cmake" CACHE STRING
|
|
44
|
+
"Where QCDXConfig.cmake and projectkit/ are installed, relative to the prefix")
|
|
45
|
+
|
|
46
|
+
install(DIRECTORY cmake/projectkit
|
|
47
|
+
DESTINATION "${QCDX_INSTALL_CMAKEDIR}"
|
|
48
|
+
USE_SOURCE_PERMISSIONS
|
|
49
|
+
PATTERN "__pycache__" EXCLUDE
|
|
50
|
+
PATTERN "*.pyc" EXCLUDE)
|
|
51
|
+
|
|
52
|
+
install(FILES cmake/QCDXConfig.cmake cmake/QCDXConfigVersion.cmake
|
|
53
|
+
DESTINATION "${QCDX_INSTALL_CMAKEDIR}")
|
qcdx-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Evan R. Reumann
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
qcdx-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,298 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: qcdx
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Create, build, test, package and release C and C++ projects with CMake and Conan
|
|
5
|
+
Project-URL: Homepage, https://github.com/cooldood155/QCDX
|
|
6
|
+
Project-URL: Documentation, https://github.com/cooldood155/QCDX#readme
|
|
7
|
+
Project-URL: Issues, https://github.com/cooldood155/QCDX/issues
|
|
8
|
+
Project-URL: Changelog, https://github.com/cooldood155/QCDX/releases
|
|
9
|
+
Author-email: "Evan R. Reumann" <evanrileyreumann@gmail.com>
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: build-system,c,c++,cmake,conan,project-template,scaffolding
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Environment :: Console
|
|
15
|
+
Classifier: Intended Audience :: Developers
|
|
16
|
+
Classifier: Operating System :: OS Independent
|
|
17
|
+
Classifier: Programming Language :: C
|
|
18
|
+
Classifier: Programming Language :: C++
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Topic :: Software Development :: Build Tools
|
|
21
|
+
Classifier: Topic :: Software Development :: Code Generators
|
|
22
|
+
Requires-Python: >=3.9
|
|
23
|
+
Provides-Extra: tools
|
|
24
|
+
Requires-Dist: cmake>=3.30; extra == 'tools'
|
|
25
|
+
Requires-Dist: conan<3,>=2.0; extra == 'tools'
|
|
26
|
+
Requires-Dist: ninja; extra == 'tools'
|
|
27
|
+
Description-Content-Type: text/markdown
|
|
28
|
+
|
|
29
|
+
# QCDX
|
|
30
|
+
|
|
31
|
+
[](https://github.com/cooldood155/QCDX/actions/workflows/verify.yml) [](https://github.com/cooldood155/QCDX/actions/workflows/release.yml)
|
|
32
|
+
|
|
33
|
+
[Documentation](#documentation)
|
|
34
|
+
|
|
35
|
+
A template for C and C++ projects built on **projectkit**, a set of CMake
|
|
36
|
+
modules and scripts under `cmake/projectkit/`. A fresh copy already contains a
|
|
37
|
+
working library, application, test and build-time tool, so it configures,
|
|
38
|
+
builds, tests, installs and packages before you start writting code.
|
|
39
|
+
|
|
40
|
+
- **CMake 3.30+, Ninja and Conan 2**, with presets for native builds, host
|
|
41
|
+
tools and cross builds.
|
|
42
|
+
- **One call per target**: `pk_create_library`, `pk_create_app`,
|
|
43
|
+
`pk_create_test` and `pk_create_tool` find their sources, headers and
|
|
44
|
+
settings by convention.
|
|
45
|
+
- **C and C++**: C++ libraries, C libraries, and C interfaces implemented in
|
|
46
|
+
C++, each with a generated export header (`export.hpp` or `export.h`).
|
|
47
|
+
- **Static, shared or both** from one build, chosen per project or pinned per
|
|
48
|
+
library.
|
|
49
|
+
- **Checks built in**: warnings, hardening, sanitizers, clang-tidy, cppcheck,
|
|
50
|
+
Valgrind and coverage, each one option away.
|
|
51
|
+
- **`pk`**, one command line for all of it, Conan and CMake never have to be
|
|
52
|
+
typed by hand.
|
|
53
|
+
|
|
54
|
+
## Requirements
|
|
55
|
+
|
|
56
|
+
| Tool | Version |
|
|
57
|
+
| :-- | :-- |
|
|
58
|
+
| CMake | 3.30 or newer |
|
|
59
|
+
| Ninja | any recent |
|
|
60
|
+
| Python | 3.8 or newer |
|
|
61
|
+
| Conan | 2.x |
|
|
62
|
+
| Git | any recent |
|
|
63
|
+
| Compiler | GCC 13+, Clang 18+, AppleClang 15+ or MSVC 19.30+ |
|
|
64
|
+
|
|
65
|
+
The scripts are Python and run from any shell. On Windows outside an MSYS2
|
|
66
|
+
shell, start them as `python scripts\pk.py ...`.
|
|
67
|
+
|
|
68
|
+
The default standards are C++23 and C23. Every supported OS, architecture and
|
|
69
|
+
toolchain combination is listed in [`docs/BUILDING.md`](docs/BUILDING.md).
|
|
70
|
+
|
|
71
|
+
## Quick start
|
|
72
|
+
|
|
73
|
+
Create a repository from the template, then clone it:
|
|
74
|
+
|
|
75
|
+
```bash
|
|
76
|
+
gh repo create my-project --template cooldood155/QCDX --public --clone
|
|
77
|
+
cd my-project
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Without the GitHub CLI, press **Use this template** on GitHub and clone the
|
|
81
|
+
new repository.
|
|
82
|
+
|
|
83
|
+
Give the project its own name. The rename covers directories, file names and
|
|
84
|
+
file contents, and refuses to run on a dirty tree so `git diff` shows exactly
|
|
85
|
+
what it changed:
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
./scripts/pk.py rename myproject --description="What this project is" --version=0.1.0
|
|
89
|
+
git diff --stat
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
Check the tools, then build, run and test:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
./scripts/pk.py doctor
|
|
96
|
+
./scripts/pk.py build
|
|
97
|
+
./scripts/pk.py run
|
|
98
|
+
./scripts/pk.py test
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
The first `build` installs the Conan dependencies and configures CMake; later
|
|
102
|
+
builds only rebuild. Every Conan and CMake command `pk` runs is printed before
|
|
103
|
+
it runs, and `-n` prints them without running anything.
|
|
104
|
+
|
|
105
|
+
Then replace this README with your own project's.
|
|
106
|
+
|
|
107
|
+
## Everyday commands
|
|
108
|
+
|
|
109
|
+
| Command | What it does |
|
|
110
|
+
| :-- | :-- |
|
|
111
|
+
| `pk build [TYPE]` | install dependencies, configure and build, each only when needed |
|
|
112
|
+
| `pk run [APP] -- ARGS` | build one application and run it |
|
|
113
|
+
| `pk test [TYPE]` | build with tests and run them with ctest |
|
|
114
|
+
| `pk stage` | install into `stage/`, check the package and write a report |
|
|
115
|
+
| `pk dep ...` | add, change, remove, update and inspect third-party packages |
|
|
116
|
+
| `pk status` | the build trees, their options and dependency state |
|
|
117
|
+
| `pk sync` | pull projectkit updates from this template |
|
|
118
|
+
| `pk full-clean` | remove everything the build generated |
|
|
119
|
+
| `pk help COMMAND` | every flag a command accepts |
|
|
120
|
+
|
|
121
|
+
Build types are `debug` (default), `release`, `relwithdebinfo` and
|
|
122
|
+
`minsizerel`. Options such as `--werror`, `--lib=shared` or
|
|
123
|
+
`--sanitize=address,undefined` are remembered per build tree.
|
|
124
|
+
|
|
125
|
+
To type `pk` instead of `./scripts/pk.py` from anywhere inside any project
|
|
126
|
+
made from this template, install the shell function for bash or PowerShell
|
|
127
|
+
once, as described in
|
|
128
|
+
[`PK.md`](cmake/projectkit/docs/PK.md#install-as-a-shell-command).
|
|
129
|
+
|
|
130
|
+
### Without pk
|
|
131
|
+
|
|
132
|
+
`pk` only decides which of these steps are needed. They can always be run by
|
|
133
|
+
hand:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
./scripts/package.py install --build_type=Debug
|
|
137
|
+
cmake --preset native-debug
|
|
138
|
+
cmake --build build/native-debug
|
|
139
|
+
ctest --test-dir build/native-debug --output-on-failure
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
## Adding code
|
|
143
|
+
|
|
144
|
+
Each kind of target lives in its own directory, named after the target:
|
|
145
|
+
|
|
146
|
+
| Target | Sources | Declared in |
|
|
147
|
+
| :-- | :-- | :-- |
|
|
148
|
+
| Library | `src/<name>/`, public headers in `include/<name>/` | `src/CMakeLists.txt` |
|
|
149
|
+
| Application | `apps/<name>/` | `apps/CMakeLists.txt` |
|
|
150
|
+
| Tests (Catch2) | `tests/<name>/` | `tests/CMakeLists.txt` |
|
|
151
|
+
| Build-time tool | `tools/` | `tools/CMakeLists.txt` |
|
|
152
|
+
|
|
153
|
+
```cmake
|
|
154
|
+
pk_create_library(NAME myproject REQUIRE_SOURCES REQUIRE_PUBLIC_HEADERS)
|
|
155
|
+
pk_create_app(NAME myproject DEFAULT_DIRS LINK_PRIVATE myproject::myproject)
|
|
156
|
+
pk_create_test(NAME myproject)
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
A library with a C interface and a C++ implementation takes `LANGUAGE C`: its
|
|
160
|
+
public headers are `.h` files, its export header becomes `export.h`, and its
|
|
161
|
+
private headers in `src/<name>/` can be C++.
|
|
162
|
+
|
|
163
|
+
The full walkthrough, including tools and cross builds, is in
|
|
164
|
+
[`docs/FROM_ZERO_TO_PROJECT.md`](docs/FROM_ZERO_TO_PROJECT.md).
|
|
165
|
+
|
|
166
|
+
## Dependencies
|
|
167
|
+
|
|
168
|
+
Third-party packages are declared once, in `deps.json`, and pinned in
|
|
169
|
+
`conan.lock`; both are committed. `conanfile.py` and the CMake creators read
|
|
170
|
+
the deps.json.
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
pk dep add "sqlite3/[>=3.45 <4]" # declare, lock (pin) and discover package/target
|
|
174
|
+
pk dep ls # what is declared, locked and used by what
|
|
175
|
+
pk dep why zlib # who pulls this package in and who uses it
|
|
176
|
+
pk dep update sqlite3 # newest version within the range
|
|
177
|
+
pk dep check # deps.json, CMake and the lock all match
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
```cmake
|
|
181
|
+
pk_create_library(NAME myproject ... DEPS_PRIVATE sqlite3)
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
Versions only change when you ask (`add`, `update`, or a new range); builds
|
|
185
|
+
fail rather than resolve past the lock. Details:
|
|
186
|
+
[`PK_DEP.md`](cmake/projectkit/docs/PK_DEP.md).
|
|
187
|
+
|
|
188
|
+
## Cross builds
|
|
189
|
+
|
|
190
|
+
Each cross target is a Conan profile in `profiles/` plus matching presets:
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
pk list
|
|
194
|
+
pk build -x x86_64-mingw-w64
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
`pk` builds the host tools natively first, then the cross build. Binaries built
|
|
198
|
+
for another system cannot run here, tests are built but not run on cross
|
|
199
|
+
builds.
|
|
200
|
+
|
|
201
|
+
## Verification and CI
|
|
202
|
+
|
|
203
|
+
`verify.py` runs the full pipeline for each build type: the preset workflow,
|
|
204
|
+
every library type, installation, a consumer project that sees only the
|
|
205
|
+
installed files, CPack and the host tools.
|
|
206
|
+
|
|
207
|
+
```bash
|
|
208
|
+
./scripts/verify.py list
|
|
209
|
+
./scripts/verify.py run --build_type=Debug,Release
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
The same script runs in CI for every push and pull request to `main` that
|
|
213
|
+
changes code: on Linux (`x86_64`, `armv8`), macOS (`armv8`) and Windows (MSYS2
|
|
214
|
+
UCRT64), and as cross builds for Windows `x86_64` (MinGW-w64) and `arm64`
|
|
215
|
+
(llvm-mingw).
|
|
216
|
+
|
|
217
|
+
## Packaging
|
|
218
|
+
|
|
219
|
+
```bash
|
|
220
|
+
./scripts/package.py create --build_type=Debug,Release
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
This builds the Conan package, then builds a small consumer against it. Other
|
|
224
|
+
projects use it like any Conan package:
|
|
225
|
+
|
|
226
|
+
```cmake
|
|
227
|
+
find_package(myproject REQUIRED)
|
|
228
|
+
target_link_libraries(other PRIVATE myproject::myproject)
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
## Releases
|
|
232
|
+
|
|
233
|
+
Push a version tag and CI builds, tests and archives every target provided then
|
|
234
|
+
creates a draft GitHub release with checksums:
|
|
235
|
+
|
|
236
|
+
```bash
|
|
237
|
+
git tag -s v1.2.0 -m "myproject 1.2.0"
|
|
238
|
+
git push origin v1.2.0
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
The tag must match `project(VERSION)`. Targets, archive contents, signing and
|
|
242
|
+
a separate releases repository are set in
|
|
243
|
+
`scripts/helpers/release/release.conf`, and every step also runs locally:
|
|
244
|
+
|
|
245
|
+
```bash
|
|
246
|
+
pk release stage linux-x86_64
|
|
247
|
+
pk release pack linux-x86_64
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
Details: [`RELEASE.md`](cmake/projectkit/docs/RELEASE.md).
|
|
251
|
+
|
|
252
|
+
## Keeping projectkit up to date
|
|
253
|
+
|
|
254
|
+
Every project made from this template carries its own copy of the kit. When
|
|
255
|
+
the template improves, bring the changes in with one command:
|
|
256
|
+
|
|
257
|
+
```bash
|
|
258
|
+
pk sync -n
|
|
259
|
+
pk sync
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
Only the template's changes are applied, as a 3-way merge, changes made to the
|
|
263
|
+
kit in your project are kept. The result is a single commit.
|
|
264
|
+
|
|
265
|
+
## Layout
|
|
266
|
+
|
|
267
|
+
```text
|
|
268
|
+
my-project/
|
|
269
|
+
CMakeLists.txt project(), pk_project_setup and the subdirectories
|
|
270
|
+
CMakePresets.json native, host-tools and cross presets
|
|
271
|
+
conanfile.py Conan recipe, version read from CMakeLists.txt
|
|
272
|
+
profiles/ Conan profiles: native, cross targets, CI
|
|
273
|
+
include/<name>/ public headers
|
|
274
|
+
src/<name>/ library sources and private headers
|
|
275
|
+
apps/<name>/ applications
|
|
276
|
+
tests/<name>/ tests
|
|
277
|
+
tools/ build-time tools
|
|
278
|
+
cmake/projectkit/ the kit, updated with pk sync
|
|
279
|
+
scripts/ pk.py, verify.py, package.py, release.py, bootstrap.py, settings
|
|
280
|
+
docs/ guides
|
|
281
|
+
```
|
|
282
|
+
|
|
283
|
+
## Documentation
|
|
284
|
+
|
|
285
|
+
| Document | Covers |
|
|
286
|
+
| :-- | :-- |
|
|
287
|
+
| [`docs/FROM_ZERO_TO_PROJECT.md`](docs/FROM_ZERO_TO_PROJECT.md) | from an empty directory to a packaged project |
|
|
288
|
+
| [`docs/BUILDING.md`](docs/BUILDING.md) | supported platforms, toolchains and cross targets |
|
|
289
|
+
| [`PK.md`](cmake/projectkit/docs/PK.md) | every `pk` command, flag and setting |
|
|
290
|
+
| [`PK_DEP.md`](cmake/projectkit/docs/PK_DEP.md) | `deps.json`, `conan.lock`, `pk dep` and `DEPS_*` |
|
|
291
|
+
| [`VERIFY.md`](cmake/projectkit/docs/VERIFY.md) | the verification pipeline and its targets |
|
|
292
|
+
| [`RELEASE.md`](cmake/projectkit/docs/RELEASE.md) | tagged releases: targets, archives, checks, signing |
|
|
293
|
+
| [`PACKAGE.md`](cmake/projectkit/docs/PACKAGE.md) | Conan packaging, editable mode and uploads |
|
|
294
|
+
| [`ANALYSER_LAUNCHER.md`](cmake/projectkit/docs/ANALYSER_LAUNCHER.md) | clang-tidy and cppcheck integration |
|
|
295
|
+
|
|
296
|
+
## License
|
|
297
|
+
|
|
298
|
+
MIT, see [`LICENSE`](LICENSE).
|