Skip to content

Commit

Permalink
cmake [KILL 3-STATE]: Rename WITH_GUI to BUILD_GUI
Browse files Browse the repository at this point in the history
Also docs and CI scripts have been updated.
  • Loading branch information
hebasto committed May 7, 2024
1 parent d06252f commit c46dd16
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ jobs:
- name: Generate build system
run: |
cmake -B build --preset ${{ matrix.conf.preset }} -DWERROR=ON
cmake -B build --preset ${{ matrix.conf.preset }} -DBUILD_GUI=ON -DWERROR=ON
- name: Save vcpkg binary cache
uses: actions/cache/save@v4
Expand Down
10 changes: 5 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module)
include(CMakeDependentOption)
# When adding a new option, end the <help_text> with a full stop for consistency.
option(BUILD_DAEMON "Build bitcoind executable." ON)
option(WITH_GUI "Build bitcoin-qt executable." OFF)
option(BUILD_GUI "Build bitcoin-qt executable." OFF)
option(BUILD_CLI "Build bitcoin-cli executable." ON)
option(BUILD_TX "Build bitcoin-tx executable." ON)
option(BUILD_UTIL "Build bitcoin-util executable." ON)
Expand Down Expand Up @@ -144,7 +144,7 @@ endif()
cmake_dependent_option(WITH_EXTERNAL_SIGNER "Enable external signer support." ON "NOT WIN32" OFF)
set(ENABLE_EXTERNAL_SIGNER ${WITH_EXTERNAL_SIGNER})

cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "WITH_GUI" OFF)
cmake_dependent_option(WITH_QRENCODE "Enable QR code support." ON "BUILD_GUI" OFF)
if(WITH_QRENCODE)
find_package(PkgConfig REQUIRED)
pkg_check_modules(libqrencode REQUIRED IMPORTED_TARGET libqrencode)
Expand All @@ -160,7 +160,7 @@ if(MULTIPROCESS)
endif()

option(BUILD_TESTS "Build test_bitcoin executable." ON)
cmake_dependent_option(BUILD_GUI_TESTS "Build test_bitcoin-qt executable." ON "WITH_GUI;BUILD_TESTS" OFF)
cmake_dependent_option(BUILD_GUI_TESTS "Build test_bitcoin-qt executable." ON "BUILD_GUI;BUILD_TESTS" OFF)
option(BUILD_BENCH "Build bench_bitcoin executable." ON)
option(BUILD_FUZZ_BINARY "Build fuzz binary." ON)
cmake_dependent_option(FUZZ "Build for fuzzing. Enabling this will disable all other targets and override BUILD_FUZZ_BINARY." OFF "NOT MSVC" OFF)
Expand Down Expand Up @@ -205,7 +205,7 @@ if(FUZZ)
set(BUILD_UTIL_CHAINSTATE OFF)
set(BUILD_KERNEL_LIB OFF)
set(BUILD_WALLET_TOOL OFF)
set(WITH_GUI OFF)
set(BUILD_GUI OFF)
set(WITH_EXTERNAL_SIGNER OFF)
set(WITH_NATPMP OFF)
set(WITH_MINIUPNPC OFF)
Expand Down Expand Up @@ -600,7 +600,7 @@ message("Configure summary")
message("=================")
message("Executables:")
message(" bitcoind ............................ ${BUILD_DAEMON}")
message(" bitcoin-qt .......................... ${WITH_GUI}")
message(" bitcoin-qt .......................... ${BUILD_GUI}")
message(" bitcoin-cli ......................... ${BUILD_CLI}")
message(" bitcoin-tx .......................... ${BUILD_TX}")
message(" bitcoin-util ........................ ${BUILD_UTIL}")
Expand Down
6 changes: 3 additions & 3 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"rhs": "Darwin"
},
"cacheVariables": {
"WITH_GUI": "Qt5",
"BUILD_GUI": "ON",
"WITH_EXTERNAL_SIGNER": "ON"
}
},
Expand All @@ -57,7 +57,7 @@
"toolchainFile": "$env{VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows",
"WITH_GUI": "Qt5",
"BUILD_GUI": "ON",
"WITH_QRENCODE": "OFF",
"WITH_NATPMP": "OFF"
}
Expand All @@ -75,7 +75,7 @@
"toolchainFile": "$env{VCPKG_ROOT}\\scripts\\buildsystems\\vcpkg.cmake",
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": "x64-windows-static",
"WITH_GUI": "Qt5",
"BUILD_GUI": "ON",
"WITH_QRENCODE": "OFF",
"WITH_NATPMP": "OFF"
}
Expand Down
4 changes: 2 additions & 2 deletions depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ set(PKG_CONFIG_ARGN --static)

# Set configuration options for the main build system.
if("@no_qt@")
set(WITH_GUI OFF CACHE BOOL "")
set(BUILD_GUI OFF CACHE BOOL "")
else()
set(WITH_GUI ON CACHE BOOL "")
set(BUILD_GUI ON CACHE BOOL "")
endif()

if(NOT WITH_QRENCODE AND "@no_qr@" STREQUAL "1")
Expand Down
10 changes: 5 additions & 5 deletions doc/build-freebsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,23 +101,23 @@ pkg install python3 databases/py-sqlite3
There are many ways to configure Bitcoin Core, here are a few common examples:

##### Descriptor Wallet and GUI:
This explicitly enables the GUI and disables legacy wallet support, assuming `sqlite` and `qt` are installed.
This disables legacy wallet support and enables the GUI, assuming `sqlite` and `qt` are installed.
```bash
cmake -B build -DWITH_BDB=OFF -DWITH_GUI=Qt5
cmake -B build -DWITH_BDB=OFF -DBUILD_GUI=ON
```

Run `cmake -B build -LH` to see the full list of available options.

##### Descriptor & Legacy Wallet. No GUI:
This enables support for both wallet types and disables the GUI, assuming
This enables support for both wallet types, assuming
`sqlite3` and `db4` are both installed.
```bash
cmake -B build -DWITH_GUI=OFF -DBerkeleyDB_INCLUDE_DIR:PATH="${BDB_PREFIX}/include"
cmake -B build -DBerkeleyDB_INCLUDE_DIR:PATH="${BDB_PREFIX}/include"
```

##### No Wallet or GUI
```bash
cmake -B build -DENABLE_WALLET=OFF -DWITH_GUI=OFF
cmake -B build -DENABLE_WALLET=OFF
```

### 2. Compile
Expand Down
8 changes: 4 additions & 4 deletions doc/build-openbsd.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,19 +79,19 @@ pkg_add install python # Select the newest version of the package.
There are many ways to configure Bitcoin Core, here are a few common examples:

##### Descriptor Wallet and GUI:
This enables the GUI and descriptor wallet support, assuming SQLite and Qt 5 are installed.
This enables descriptor wallet support and the GUI, assuming SQLite and Qt 5 are installed.

```bash
cmake -B build -DWITH_SQLITE=ON -DWITH_GUI=Qt5
cmake -B build -DWITH_SQLITE=ON -DBUILD_GUI=ON
```

Run `cmake -B build -LH` to see the full list of available options.

##### Descriptor & Legacy Wallet. No GUI:
This enables support for both wallet types and disables the GUI:
This enables support for both wallet types:

```bash
cmake -B build -DWITH_GUI=OFF -DBerkeleyDB_INCLUDE_DIR:PATH="${BDB_PREFIX}/include"
cmake -B build -DBerkeleyDB_INCLUDE_DIR:PATH="${BDB_PREFIX}/include"
```

### 2. Compile
Expand Down
9 changes: 4 additions & 5 deletions doc/build-osx.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,27 +190,26 @@ There are many ways to configure Bitcoin Core, here are a few common examples:

If `berkeley-db@4` is installed, then legacy wallet support will be built.
If `sqlite` is installed, then descriptor wallet support will also be built.
Additionally, this explicitly disables the GUI.

``` bash
cmake -B build -DWITH_GUI=OFF
cmake -B build
```

##### Wallet (only SQlite) and GUI Support:

This explicitly enables the GUI and disables legacy wallet support.
This enables the GUI and disables legacy wallet support.
If `qt` is not installed, this will throw an error.
If `sqlite` is installed then descriptor wallet functionality will be built.
If `sqlite` is not installed, then wallet functionality will be disabled.

``` bash
cmake -B build -DWITH_BDB=OFF -DWITH_GUI=Qt5
cmake -B build -DWITH_BDB=OFF -DBUILD_GUI=ON
```

##### No Wallet or GUI

``` bash
cmake -B build -DENABLE_WALLET=OFF -DWITH_GUI=OFF
cmake -B build -DENABLE_WALLET=OFF
```

##### Further Configuration
Expand Down
8 changes: 4 additions & 4 deletions doc/build-windows-msvc.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ CMake will put the resulting object files, libraries, and executables into a ded

In following istructions, the "Debug" configuration can be specified instead of the "Release" one.

### 4. Building with Dynamic Linking
### 4. Building with Dynamic Linking with GUI

```
cmake -B build --preset vs2022 # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
cmake -B build --preset vs2022 -DBUILD_GUI=ON # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
cmake --build build --config Release # Use "-j N" for N parallel jobs.
ctest --test-dir build --build-config Release # Use "-j N" for N parallel tests. Some tests are disabled if Python 3 is not available.
```

### 5. Building with Static Linking
### 5. Building with Static Linking without GUI

```
cmake -B build --preset vs2022-static # It might take a while if the vcpkg binary cache is unpopulated or invalidated.
Expand All @@ -72,7 +72,7 @@ cmake --install build --config Release # Optional.
One can skip vcpkg manifest default features to speedup the configuration step.
For example, the following invocation will skip all features except for "wallet" and "tests" and their dependencies:
```
cmake -B build --preset vs2022 -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet;tests"
cmake -B build --preset vs2022 -DVCPKG_MANIFEST_NO_DEFAULT_FEATURES=ON -DVCPKG_MANIFEST_FEATURES="wallet;tests" -DBUILD_GUI=OFF
```

Available features are listed in the [`vcpkg.json`](/vcpkg.json) file.
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ if(BUILD_UTIL)
endif()


if(WITH_GUI)
if(BUILD_GUI)
add_subdirectory(qt)
endif()

Expand Down

0 comments on commit c46dd16

Please sign in to comment.