43.6. cmake-4.4.3
Cross-platform build-system generator
| Version | 4.4.3, release 1 |
| Shelf | buildtools — Build systems and build helpers |
| Phase | 30_foundation (Build Foundation), 60 of 127 in build order |
| Licence | BSD-3-Clause |
| Homepage | https://cmake.org/ |
| Build time | 10.0 SBU |
| Installed size | 80.6 MiB in 4182 files |
| Recipe | ports/core/buildtools/cmake/kpkgbuild |
About
CMake generates the build files of a large share of the tree’s C and C++ ports, and cpack, ctest and ccmake, its curses interface, come with it. It is built in the opening run of 30_foundation, where no CMake exists yet, so it is configured with its own bootstrap script: the script compiles a minimal CMake from the source with the C and C++ compilers alone, and that CMake then configures and builds the full one with Make. How a CMake port is written in this tree is in Writing ports.
The port’s dependencies are built ahead of it in the same run, Sphinx and its Python modules among them (see Part VI).
Why it is in KDOS
The comment above the 24 ports from fortify-headers to musl-utils in script/phases/30_foundation/packages.txt is quoted in The build foundation.
Sources
cmake-4.4.3.tar.gz(12.7 MiB)
sha256c46400618b4f1f2b43507f24fb22f3ae830c3416cf23b776e16e1d413aa892f0
upstream: https://www.cmake.org/files/v4.4/cmake-4.4.3.tar.gz
archive copy: sources-1/buildtools--cmake-4.4.3.tar.gz
Dependencies
Depends on: openssl, nghttp2, libarchive, libuv, expat, ncurses, python3-sphinx.
Required by (917): abseil-cpp, accessibility-inspector, airspy, airspyhf, akonadi, akonadi-calendar, akonadi-calendar-tools, akonadi-contacts, akonadi-import-wizard, akonadi-mime, akonadi-search, akonadiconsole, akregator, alembic, alligator, amiberry, analitza, android-file-transfer, android-tools, angelfish, aptdec, arianna, ark, arpack-ng, artikulate, assimp, attica, audacity, audex, audiocd-kio, audiotube, aurorae, avidemux, avogadrolibs, avrdude, ayatana-ido, baloo, baloo-widgets, baresip, bcc, black-hole-solver, bladerf, blend2d, blender, blinken, bluedevil, bluez-qt, bomber, bovo, bpftrace, breeze, breeze-gtk, breeze-icons, brlaser, brotli, c-ares, c-blosc, calendarsupport, calibre, calindori, calligra, can-utils, cantor, capstone, castxml, ccache, celestia, celestia-content, cereal, ceres-solver, cgal, chess-tui, chromaprint, cjson, clamav, clipper2, cm256cc, cmark, codec2, coin, compiler-rt, converseen, coolprop, corrosion, cpp-utilities, cppcheck, cppzmq, cspice, cubicsdr, curaengine, cxx-rust-cssparser, darktable, dcmtk, ddnet, devilutionx, diamond, digikam, direwolf, discover, docopt.cpp, dolphin, dolphin-plugins, dosbox-staging, double-conversion, doxygen, draco, dragon, dsda-doom, dsdcc, duckdb, dwarves, ebook-tools, eigen, elisa, embree, endless-sky, eventviews, exiv2, extra-cmake-modules, faad2, falkon, fast-double-parser, fastfetch, fcitx5, fcitx5-anthy, fcitx5-chinese-addons, fcitx5-configtool, fcitx5-gtk, fcitx5-hangul, fcitx5-qt, fdk-aac, ffmpegthumbs, fheroes2, filelight, flameshot, flare-engine, flare-game, fltk, fluidsynth, fmt, fontforge, frameworkintegration, francis, freecad, freecell-solver, freedv-gui, freeglut, freerdp, frei0r-plugins, ft2-clone, furnace, futuresql, gcompris, gdal, geos, gflags, ggmorse, ghostwriter, gimagereader, gl2ps, glaxnimate, glew, glfw, glm, glog, glslang, gmsh, gnucash, gnuradio, goldendict-ng, gpgmepp, gqrx, gr-funcube, gr-iqbal, gr-osmosdr, granatier, grantlee-editor, grantleetheme, graphite2, gtest, gwenview, hackrf, handbrake, haruna, hatari, hdf5, hidapi, highs, highway, horizon-eda, hydrogen, ifcopenshell, iir1, imath, imhex, immer, incidenceeditor, iniparser, inkscape, inspectrum, intel-gmmlib, intel-media-driver, ioquake3, isoimagewriter, ispc, itinerary, jasper, js8call, json-c, juk, k3b, kaccounts-integration, kaccounts-providers, kactivitymanagerd, kaddressbook, kajongg, kalarm, kalgebra, kalk, kalm, kalzium, kamera, kamoso, kanagram, kapman, kapptemplate, karchive, kasts, kate, katomic, kauth, kbackup, kblackbox, kblocks, kbookmarks, kbounce, kbreakout, kbruch, kcachegrind, kcalc, kcalendarcore, kcalutils, kcharselect, kclock, kcm-kdos-firewall, kcm-kdos-health, kcm-kdos-look, kcmutils, kcodecs, kcolorchooser, kcolorpicker, kcolorscheme, kcompletion, kconfig, kconfigwidgets, kcontacts, kcoreaddons, kcrash, kcron, kdav, kdbusaddons, kddockwidgets, kde-cli-tools, kde-dev-scripts, kde-dev-utils, kde-gtk-config, kde-inotify-survey, kdebugsettings, kdeclarative, kdeconnect, kdecoration, kded, kded-kdos, kdeedu-data, kdegraphics-mobipocket, kdegraphics-thumbnailers, kdenetwork-filesharing, kdenlive, kdepim-addons, kdepim-runtime, kdeplasma-addons, kdesdk-kio, kdesdk-thumbnailers, kdesu, kdev-php, kdev-python, kdevelop, kdevelop-pg-qt, kdf, kdiagram, kdialog, kdiamond, kdiff3, kdnssd, kdoctools, kdominate, kdos-discover, kdos-installer-gui, kdos-kwin-motion, kdos-transcribe, kdos-welcome, kdsingleapplication, kdsoap, kdsoap-ws-discovery-client, keditbookmarks, keepassxc, keepsecret, keysmith, kfilemetadata, kfind, kfourinline, kgeography, kget, kglobalaccel, kglobalacceld, kgoldrunner, kgpg, kgraphviewer, kguiaddons, khangman, khealthcertificate, khelpcenter, kholidays, ki18n, kicad, kicad-footprints, kicad-symbols, kicad-templates, kiconthemes, kidentitymanagement, kidletime, kig, kigo, killbots, kimageannotator, kimageformats, kimagemapeditor, kimap, kinfocenter, kio, kio-admin, kio-extras, kio-fuse, kio-gdrive, kio-library, kio-zeroconf, kirigami, kirigami-addons, kirigami-app-components, kirigami-gallery, kiriki, kitemmodels, kitemviews, kiten, kitinerary, kjobwidgets, kjumpingcube, kldap, kleopatra, klettres, klickety, klines, klog, kmahjongg, kmail, kmail-account-wizard, kmailtransport, kmbox, kmenuedit, kmime, kmines, kmix, kmouth, kmplot, knavalbattle, knetwalk, knewstuff, knights, knighttime, knotifications, knotifyconfig, kodi, koko, kolf, kollision, kolourpaint, kompare, kongress, konqueror, konquest, konsole, kontact, kontactinterface, kontrast, konversation, kopeninghours, koreader, korganizer, kosmindoormap, kpackage, kparts, kpat, kpeople, kpimtextedit, kpipewire, kpkpass, kplotting, kpmcore, kpty, kpublictransport, kqtquickcharts, kquickcharts, kquickimageeditor, krdc, krdp, krecorder, kreversi, krfb, krita, kruler, krunner, ksanecore, kscreen, kscreenlocker, kseexpr, kservice, kshisen, ksirk, ksmtp, ksnakeduel, kspaceduel, ksquares, ksshaskpass, kstatusnotifieritem, ksudoku, ksvg, ksystemlog, ksystemstats, ksystemstats-kdos, kteatime, ktextaddons, ktexteditor, ktexttemplate, ktextwidgets, ktimer, ktnef, ktorrent, ktouch, ktrip, ktuberling, kturtle, kubrick, kunifiedpush, kunitconversion, kup, kwallet, kwallet-pam, kwalletmanager, kwave, kwayland, kweather, kweathercore, kwidgetsaddons, kwin, kwin-effect-kdos-keys, kwin-script-kdos-runraise, kwin-script-kdos-window-memory, kwindowsystem, kwordquiz, kwrited, kxmlgui, labplot, lager, lagrange, layer-shell-qt, ldacbt, ledger, lensfun, lib2geom, lib3mf, libad9361, libaec, libarcus, libavif, libayatana-appindicator, libayatana-indicator, libcbor, libcec, libcerf, libclc, libcue, libdab, libdbusmenu-lxqt, libdbusmenu-qt5, libde265, libdeflate, libebml, libebur128, libfido2, libfobos, libftdi, libggml, libgit2, libgme, libgravatar, libharu, libheif, libical, libid3tag, libiio, libime, libinmarsatc, libjpeg-turbo, libjxl, libkcddb, libkdcraw, libkdegames, libkdepim, libkeduvocdocument, libkexiv2, libkgapi, libkleo, libkmahjongg, libkomparediff2, libksane, libkscreen, libksieve, libksysguard, libktorrent, libmad, libmatroska, libmed, libmediainfo, libmirisdr, libmt32emu, libmusicbrainz5, libmysofa, libnfs, libphonenumber, libplasma, libpoly, libqaccessibilityclient, libquotient, libre, librecad, librepcb, libretro-mgba, libsamplerate, libsavitar, libsbsms, libsigmf, libsndfile, libsoundio, libspatialindex, libsrt, libssh, libtiff, libtorrent-rasterbar, libvncserver, libvolk, libwebp, libwebsockets, libxlsxwriter, libxmp, libyuv, libzen, libzip, limesuite, limesuite-gui, liquid-dsp, llama.cpp, llvm, llvm21, lmms, lokalize, lskat, luanti, mailcommon, mailimporter, manifold, marble, markdownpart, massif-visualizer, mbedtls, mbelib, mbox-importer, mbpoll, mediainfo, merkuro, meshoptimizer, messagelib, mgba, milkytracker, milou, mimetreeparser, miniupnpc, minizip-ng, minuet, mlt, modemmanager-qt, mosquitto, mpvqt, mtxclient, multimon-ng, mumble, musescore, musl-locales, neochat, neovim, netcdf-c, netgen, networkmanager-qt, nextpnr, nheko, nlohmann-json, nlopt, nng, nvtop, obs-studio, ocean-sound-theme, oidn, okular, olm, onetbb, onnxruntime, openal-soft, openbabel, opencascade, opencc, opencl-clhpp, opencl-headers, opencolorio, opencpn, opencsg, opencv, openexr, openfpgaloader, openimageio, openjpeg, openmp, openrct2, openscad, opensubdiv, opentimelineio, openttd, openvdb, optipng, orcaslicer, organicmaps, oxygen, oxygen-sounds, palapeli, parley, partitionmanager, pdal, pdf4qt, phonon, phonon-backend-vlc, physfs, picmi, picotool, pim-data-exporter, pim-sieve-editor, pimcommon, pioneer, piper, pivy, plasma-activities, plasma-activities-stats, plasma-browser-integration, plasma-camera, plasma-desktop, plasma-disks, plasma-integration, plasma-keyboard, plasma-nm, plasma-pa, plasma-phonebook, plasma-sdk, plasma-setup, plasma-systemmonitor, plasma-thunderbolt, plasma-vault, plasma-wayland-protocols, plasma-welcome, plasma-workspace, plasma-workspace-wallpapers, plasma5support, plasmatube, plasmoid-kdos-checklist, plasmoid-kdos-privacy, plutosvg, plutovg, poco, podofo, polkit-kde-agent-1, polkit-qt6, polyclipping, poppler, portmidi, portsmf, powerdevil, poxml, ppsspp, print-manager, prison, prjtrellis, proj, protobuf, prusaslicer, pt2-clone, ptouch-print, pugixml, pulseaudio-qt, purpose, pystring, python3-iminuit, python3-nanobind, python3-pikepdf, python3-pybind11, python3-pyside6, python3-pyuvula, python3-pyzmq, python3-scikit-build-core, qbittorrent, qca, qca-qt5, qcad, qcoro, qgis, qgpgme, qhull, qmapshack, qmlkonsole, qownnotes, qpdf, qqc2-breeze-style, qqc2-desktop-style, qrca, qrupdate, qt-creator, qt5ct, qt6-qt3d, qt6-qt5compat, qt6-qtbase, qt6-qtcharts, qt6-qtconnectivity, qt6-qtdeclarative, qt6-qtgraphs, qt6-qthttpserver, qt6-qtimageformats, qt6-qtlanguageserver, qt6-qtlocation, qt6-qtmqtt, qt6-qtmultimedia, qt6-qtnetworkauth, qt6-qtpositioning, qt6-qtquick3d, qt6-qtremoteobjects, qt6-qtscxml, qt6-qtsensors, qt6-qtserialport, qt6-qtshadertools, qt6-qtspeech, qt6-qtsvg, qt6-qttools, qt6-qttranslations, qt6-qtvirtualkeyboard, qt6-qtwayland, qt6-qtwebchannel, qt6-qtwebengine, qt6-qtwebsockets, qt6-qtwebview, qtforkawesome, qtkeychain, qtspell, qtutilities, quassel, quazip, qucs-s, range-v3, rapidjson, rawtherapee, re2, remmina, rinutils, rkward, rocs, rtl-433, rtl-sdr, rtmidi, rttr, rust, satdump, sdcv, sddm, sddm-kcm, sdl12-compat, sdl2-compat, sdl2-image, sdl2-mixer, sdl2-net, sdl2-ttf, sdl3, sdl3-image, sdl3-mixer, sdl3-ttf, sdrangel, sdrpp, selenium-webdriver-at-spi, serialdv, sgp4, shaderc, shapelib, shotcut, signon-kwallet-extension, skanlite, skanpage, skladnik, snappy, sniffnet, soapyairspy, soapybladerf, soapyhackrf, soapyrtlsdr, soapysdr, solid, solvespace, sonnet, sonnet-qt5, soqt, soundtouch, soxr, spdlog, spectacle, spirv-headers, spirv-llvm-translator, spirv-tools, sqlitebrowser, srb2, srecord, stellarium, step, stlink, stlink-gui, strawberry, suitesparse, sundials, supertux, supertuxkart, surfer, svgpart, svt-av1, sweeper, syncthingtray, syndication, syntax-highlighting, systemsettings, taglib, taskwarrior, telly-skout, tenacity, tesseract, texstudio, threadweaver, thrift, timewarrior, timg, tinyxml2, tokodon, translatelocally, transmission, uchardet, uhd, umbrello, union, unshield, uriparser, utf8proc, utfcpp, vidstab, vtk, vulkan-headers, vulkan-loader, vulkan-tools, warzone2100, wavpack, waylandpp, webkitgtk, webkitgtk6, weechat, wesnoth, whisper.cpp, widelands, wireshark, woff2, wsjtx, wxwidgets, x265, xdg-desktop-portal-kde, xerces-c, xsettingsd, xsimd, yajl, yakuake, yaml-cpp, yosys, z3, zanshin, zeal, zig, zint, zlib-ng, zopfli, zug, zxing-cpp, zziplib.
Patches
build.sh applies these; kpkg applies nothing by itself.
gnuinstalldirs-lib.patch— Deletes the branch ofModules/GNUInstallDirs.cmakethat makesCMAKE_INSTALL_LIBDIRdefault tolib64on a 64-bit Linux system it does not recognise as Alpine, Arch, Debian or a conda environment, by the files/etc/alpine-release,/etc/arch-releaseand/etc/debian_version. KDOS has none of them, and with the branch gone the default islib./usr/lib64is only a link to/usr/libon KDOS (see Syncingfs/), and the package lint refuses a package with ausr/lib64path (see The package lint). The patch changes every CMake port built after it, not CMake alone.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/30_foundation/phase.env && kpkg install cmake'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/buildtools/cmake.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/buildtools/cmake
echo 'c46400618b4f1f2b43507f24fb22f3ae830c3416cf23b776e16e1d413aa892f0 cmake-4.4.3.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/cmake
SRC=$SRC_ROOT/cmake-4.4.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf cmake-4.4.3.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 --no-backup-if-mismatch -i "$PORT_SRC/gnuinstalldirs-lib.patch"
export CXXFLAGS="$CXXFLAGS -include cstdint"
./bootstrap \
--prefix=/usr \
--datadir=/share/$name \
--docdir=/share/doc/$name \
--mandir=/share/man \
--sphinx-man \
--sphinx-build=/usr/bin/sphinx-build \
--no-system-jsoncpp \
--no-system-cppdap \
--no-system-librhash \
--no-system-curl \
--system-libs \
-- -D CMAKE_BUILD_TYPE=Release \
-D CMake_BUILD_LTO=ON \
-D BUILD_CursesDialog=ON \
-D CMAKE_REQUIRE_FIND_PACKAGE_Curses=ON \
-D BUILD_TESTING=OFF
make
make DESTDIR=$PKG install
The switches, and why each is set:
--no-backup-if-mismatch— Keeppatchfrom leaving aGNUInstallDirs.cmake.origbeside the patched module if the hunk applies at an offset or with fuzz. The install copies the wholeModulesdirectory, so a.origwould be shipped, and the package lint refuses one (see What the package lint refuses).-include cstdint— Include<cstdint>ahead of every C++ source file, which declares the fixed-width integer types in each file whether or not it includes the header itself. GCC’s C++ library headers do not bring<cstdint>in on the way to their own, so a source file that usesuint64_tand the other fixed-width types without including it does not compile (see A standard header the source never includes).--datadir— Install the modules, templates and help under/usr/share/cmake. The bootstrap takes these directories relative to the prefix, so each value starts with/and names nousr. Upstream’s default,share/cmake-<major>.<minor>, changes its name with each minor release.--docdir— Install the documentation under/usr/share/doc/cmake. The bootstrap’s default,doc/cmake-<major>.<minor>, puts it in/usr/doc, a path the package lint refuses (see The package lint).--mandir— Install the manual pages under/usr/share/man, where every port puts its pages. The bootstrap’s default isman, which would put them in/usr/man, outside the manual roots the image’s index covers (see Databases stamped into the image).--sphinx-man— Build the manual pages from CMake’s reStructuredText documentation with Sphinx. The source ships no formatted pages, so without it the package has none; this is why the recipe depends on python3-sphinx (see Manual pages).--sphinx-build— Thesphinx-buildto run,/usr/bin/sphinx-build.--system-libs— Link the system’s copy of every third-party library CMake can use instead of the copy bundled in its source: zlib, bzip2, liblzma, zstd, nghttp2, libarchive, libuv, Expat, ncurses’ libform (forccmake), curl, jsoncpp, cppdap and librhash. The four--no-system-switches before it take the last four back: CMake applies--system-libsonly to a library no switch of its own has decided, whatever the order on the command line.--no-system-jsoncpp— Use the bundled jsoncpp. jsoncpp is a port of41_system, a later phase.--no-system-cppdap— Use the bundled cppdap, the Debug Adapter Protocol library behindcmake --debugger. It is not a port in the tree.--no-system-librhash— Use the bundled librhash, the hash library behind CMake’sfile(HASH)andstring(HASH)commands. It is not a port in the tree.--no-system-curl— Use the bundled curl. curl cannot be a dependency of CMake: it depends on brotli, which is built with CMake.CMake_BUILD_LTO=ON— Build CMake itself with link-time optimisation, through CMake’s own option for it, when the compiler supports it.BUILD_CursesDialog=ON— Buildccmake. Left unset, CMake decides by test-compiling a curses program and quietly leavesccmakeout when that fails.CMAKE_REQUIRE_FIND_PACKAGE_Curses=ON— Make CMake’sfind_package(Curses)required, so a missing ncurses stops the configure. WithBUILD_CursesDialog=ONalone, a missing ncurses only warns and turnsccmakeoff.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/cmake, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf cmake-4.4.3-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/cmake, and runs the triggers its paths call for.
Contents
Installed programs: ccmake, cmake, cpack, ctest.
Installed directories: /usr/share/cmake/Help, /usr/share/cmake/Modules/AndroidTestUtilities, /usr/share/cmake/Modules/CMakeAddFortranSubdirectory, /usr/share/cmake/Modules/CheckIPOSupported, /usr/share/cmake/Modules/Compiler, /usr/share/cmake/Modules/CompilerId, /usr/share/cmake/Modules/ExternalProject, /usr/share/cmake/Modules/FetchContent, /usr/share/cmake/Modules/FindCUDA, /usr/share/cmake/Modules/FindMPI, /usr/share/cmake/Modules/FindPython, /usr/share/cmake/Modules/FortranCInterface, /usr/share/cmake/Modules/GoogleTest, /usr/share/cmake/Modules/IntelVSImplicitPath, /usr/share/cmake/Modules/Internal, /usr/share/cmake/Modules/Linker, /usr/share/cmake/Modules/Platform, /usr/share/cmake/Modules/UseJava, /usr/share/cmake/Modules/UseSWIG, /usr/share/cmake/Templates, /usr/share/doc/cmake, /usr/share/licenses/cmake, /usr/share/vim/vimfiles.
Short descriptions
ccmake |
CMake Curses Dialog Command-Line Reference |
cmake |
CMake Command-Line Reference |
cpack |
CPack Command-Line Reference |
ctest |
CTest Command-Line Reference ctest(1) Synopsis Description |
Notes
CMake’s configure output names what it bundles, as Using bundled: CPPDAP CURL JSONCPP LIBRHASH KWIML. KWIML, Kitware’s header-only library of ABI and integer macros, is taken from the system only when it is asked for by name, which --system-libs does not do. Every other third-party library comes from the system, and one that --system-libs asks for and does not find stops the configure with an error rather than falling back to the bundled copy.