This issue will be updated to reflect the current state of CMake integration.
A brief historical context:
- #25797 proposed a CMake-based build system with 100% feature parity to the Autotools-based one.
- The reviewing process is happening in this repo as suggested in #27060 (comment).
- The recent discussion at CoreDev – https://btctranscripts.com/bitcoin-core-dev-tech/2023-09/cmake/
How reviewing happens:
- Pull requests are opened against the https://github.com/hebasto/bitcoin/tree/cmake-staging branch.
- After reviewing and merging them, the staging branch get synced with the main branch from this repo.
- This loop continues until all commits from #25797 get reviewed.
The planned chunks of work:
- The root
CMakeLists.txtandconfig/bitcoin-config.hfiles – https://github.com/hebasto/bitcoin/pull/5 - Project-wide system introspections; the
leveldbbuild target – https://github.com/hebasto/bitcoin/pull/6 - The
bitcoindbuild target – https://github.com/hebasto/bitcoin/pull/7 - Cross-compiling support – https://github.com/hebasto/bitcoin/pull/10
- Ccache support;
libnatpmp,libminiupnpc,libzmqandsystemtap-sdtoptional packages support – https://github.com/hebasto/bitcoin/pull/13 - Utility binaries, wallet functionality,
bench_bitcoinandtest_bitcoin– https://github.com/hebasto/bitcoin/pull/15 - Handling different build configurations – https://github.com/hebasto/bitcoin/pull/18
- Hardening, shared libraries – https://github.com/hebasto/bitcoin/pull/32
BuildSee #29189libbitcoinconsensuslibrary – https://github.com/hebasto/bitcoin/pull/41- Qt stuff – https://github.com/hebasto/bitcoin/pull/77
- Guix builds – https://github.com/hebasto/bitcoin/pull/67
- Building for fuzzing – https://github.com/hebasto/bitcoin/pull/43
- multiprocess support – https://github.com/hebasto/bitcoin/pull/118
-
libbitcoin-kernelandbitcoin-chainstate– https://github.com/hebasto/bitcoin/pull/134 - CI stuff – https://github.com/hebasto/bitcoin/pull/142
Building for AndroidSee #30049
The current minimum required CMake version is 3.13, which is the system package on Debian 10. Considering the timings of Debian 10 LTS EOL and integrating CMake into this repo, it seems reasonable to bump the minimum supported version up to 3.16, which is the system package on Ubuntu 20.04 LTS.
- Bump minimum supported CMake version from 3.13 up to 3.16 – https://github.com/hebasto/bitcoin/pull/33
To hold the 100% feature parity, the current CMake-based build system implementation can autodetect an optional package and enable it as Autotools-based one does. However, it was suggested to make all optional package opt-in by default. See:
-
https://github.com/hebasto/bitcoin/pull/12#discussion_r1156251913
-
https://github.com/hebasto/bitcoin/pull/12#discussion_r1157570678
-
https://github.com/hebasto/bitcoin/pull/13#discussion_r1164377093
-
Make all optional package opt-in by default
Autotools vs CMake Feature Parity Table is available here.
To list CMake’s options, one might add the -LH option during configuring step.
Updated build docs: