Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 38 additions & 16 deletions .github/workflows/cmake-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
- minimal
- no-asm
- gui-full
- gui-qt6
- system-libs
include:
- tag: no-asm
Expand All @@ -33,6 +34,15 @@ jobs:
-DENABLE_QRENCODE=ON
-DENABLE_UPNP=ON
-DUSE_DBUS=ON
- tag: gui-qt6
deps: >-
qt6-base-dev
qt6-5compat-dev
qt6-tools-dev
options: >-
-DENABLE_GUI=ON
-DUSE_DBUS=ON
-DUSE_QT6=ON
- tag: system-libs
deps: >-
libdb5.3++-dev
Expand All @@ -49,23 +59,10 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
uses: awalsh128/cache-apt-pkgs-action@v1
with:
packages: >-
${{matrix.deps}}
ccache
cmake
libcurl4-openssl-dev
libssl-dev
libzip-dev
ninja-build
pkgconf
zipcmp
zipmerge
ziptool
version: ${{matrix.tag}}
- name: Install Boost dependencies
run: sudo apt-get install -y --no-install-recommends
${{matrix.deps}}
ccache
cmake
libboost-dev
libboost-date-time-dev
libboost-exception-dev
Expand All @@ -74,6 +71,14 @@ jobs:
libboost-serialization-dev
libboost-test-dev
libboost-thread-dev
libcurl4-openssl-dev
libssl-dev
libzip-dev
ninja-build
pkgconf
zipcmp
zipmerge
ziptool
- name: Configure
run: cmake
-B ${{github.workspace}}/build -G Ninja
Expand Down Expand Up @@ -118,6 +123,7 @@ jobs:
- minimal
- no-asm
- gui-full
- gui-qt6
- system-libs
include:
- tag: no-asm
Expand All @@ -133,6 +139,13 @@ jobs:
-DQt5_DIR=$(brew --prefix qt@5)/lib/cmake/Qt5
-DENABLE_QRENCODE=ON
-DENABLE_UPNP=ON
- tag: gui-qt6
deps: >-
qt@6
options: >-
-DENABLE_GUI=ON
-DQt6_DIR=$(brew --prefix qt@6)/lib/cmake/Qt6
-DUSE_QT6=ON
- tag: system-libs
deps: >-
berkeley-db@5
Expand Down Expand Up @@ -209,6 +222,7 @@ jobs:
- minimal
- no-asm
- gui-full
- gui-qt6
include:
- tag: no-asm
deps: null
Expand All @@ -223,6 +237,14 @@ jobs:
-DENABLE_GUI=ON
-DENABLE_QRENCODE=ON
-DENABLE_UPNP=ON
- tag: gui-qt6
deps: >-
qt6-base:p
qt6-5compat:p
qt6-tools:p
options: >-
-DENABLE_GUI=ON
-DUSE_QT6=ON
steps:
- name: Checkout
uses: actions/checkout@v4
Expand Down
56 changes: 36 additions & 20 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ option(ENABLE_QRENCODE "Enable generation of QR Codes for receiving payments" O
option(ENABLE_UPNP "Enable UPnP port mapping support" OFF)
option(DEFAULT_UPNP "Turn UPnP on startup" OFF)
option(USE_DBUS "Enable DBus support" OFF)
option(USE_QT6 "Use Qt 6 instead of Qt 5" OFF)

# Bundled packages
option(SYSTEM_BDB "Find system installation of Berkeley DB CXX 5.3" OFF)
option(SYSTEM_BDB "Find system installation of Berkeley DB CXX 5.3" OFF)
option(SYSTEM_LEVELDB "Find system installation of leveldb" OFF)
option(SYSTEM_SECP256K1 "Find system installation of libsecp256k1 with pkg-config" OFF)
option(SYSTEM_UNIVALUE "Find system installation of Univalue with pkg-config" OFF)
Expand All @@ -114,20 +115,24 @@ option(BUNDLED_BOOST "Use the bundled version of Boost" ${HUNTER_ENABLED})
option(BUNDLED_CURL "Use the bundled version of cURL" ${HUNTER_ENABLED})
option(BUNDLED_LIBZIP "Use the bundled version of libzip" ${HUNTER_ENABLED})
option(BUNDLED_OPENSSL "Use the bundled version of OpenSSL" ${HUNTER_ENABLED})
option(BUNDLED_QT "Use the bundled version of Qt" ${HUNTER_ENABLED})
option(BUNDLED_QT5 "Use the bundled version of Qt 5" ${HUNTER_ENABLED})


# Handle dependencies
# ===================

set(QT5_MINIMUM_VERSION 5.9.5)
set(QT5_COMPONENTS Concurrent Core Gui LinguistTools Network Widgets)
set(QT5_HUNTER_COMPONENTS qtbase qttools)
set(QT6_MINIMUM_VERSION 6.2.0)
set(QT_COMPONENTS Core Concurrent Gui LinguistTools Network Widgets)
set(QT_HUNTER_COMPONENTS qtbase qttools)
if(USE_QT6)
list(APPEND QT_COMPONENTS Core5Compat)
endif()
if(USE_DBUS)
list(APPEND QT5_COMPONENTS DBus)
list(APPEND QT_COMPONENTS DBus)
endif()
if(ENABLE_TESTS)
list(APPEND QT5_COMPONENTS Test)
list(APPEND QT_COMPONENTS Test)
endif()

set(BOOST_MINIMUM_VERSION 1.63.0)
Expand Down Expand Up @@ -199,25 +204,36 @@ if(USE_ASM)
endif()

if(ENABLE_GUI)
if(BUNDLED_QT)
hunter_add_package(Qt COMPONENTS ${QT5_HUNTER_COMPONENTS})
set(QT_MACOS_DISABLE_DARK_MODE False)
if(USE_QT6)
find_package(Qt6 ${QT6_MINIMUM_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED)
set(QT Qt6)
else()
if(BUNDLED_QT5)
hunter_add_package(Qt COMPONENTS ${QT_HUNTER_COMPONENTS})
endif()
find_package(Qt5 ${QT5_MINIMUM_VERSION} COMPONENTS ${QT_COMPONENTS} REQUIRED)
set(QT Qt5)

if(Qt5Core_VERSION VERSION_LESS 5.12.0)
set(QT_MACOS_DISABLE_DARK_MODE True)
endif()

# Compatibility macros
if(Qt5Core_VERSION VERSION_LESS 5.15.0)
macro(qt_create_translation)
qt5_create_translation(${ARGN})
endmacro()

macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()
endif()
endif()
find_package(Qt5 ${QT5_MINIMUM_VERSION} COMPONENTS ${QT5_COMPONENTS} REQUIRED)

if(ENABLE_QRENCODE)
pkg_check_modules(QRENCODE REQUIRED IMPORTED_TARGET libqrencode)
endif()

# Compatibility macros
if(Qt5Core_VERSION VERSION_LESS 5.15.0)
macro(qt_create_translation)
qt5_create_translation(${ARGN})
endmacro()

macro(qt_add_translation)
qt5_add_translation(${ARGN})
endmacro()
endif()
endif()

if(ENABLE_UPNP)
Expand Down
106 changes: 106 additions & 0 deletions share/qt/Info.plist.cmake.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist SYSTEM "file://localhost/System/Library/DTDs/PropertyList.dtd">
<plist version="0.9">
<dict>
<key>LSMinimumSystemVersion</key>
<string>10.8.0</string>

<key>LSArchitecturePriority</key>
<array>
<string>x86_64</string>
</array>

<key>CFBundleIconFile</key>
<string>gridcoin.icns</string>

<key>CFBundlePackageType</key>
<string>APPL</string>

<key>CFBundleGetInfoString</key>
<string>@PROJECT_VERSION@, Copyright © 2009-@COPYRIGHT_YEAR@ @COPYRIGHT_HOLDERS_FINAL@</string>

<key>CFBundleShortVersionString</key>
<string>@PROJECT_VERSION@</string>

<key>CFBundleVersion</key>
<string>@PROJECT_VERSION@</string>

<key>CFBundleSignature</key>
<string>????</string>

<key>CFBundleExecutable</key>
<string>gridcoinresearch</string>

<key>CFBundleName</key>
<string>Gridcoin</string>

<key>LSHasLocalizedDisplayName</key>
<true/>

<key>CFBundleIdentifier</key>
<string>world.gridcoin.Gridcoin-Qt</string>

<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleURLName</key>
<string>world.gridcoin.GridcoinPayment</string>
<key>CFBundleURLSchemes</key>
<array>
<string>gridcoin</string>
</array>
</dict>
</array>

<key>UTExportedTypeDeclarations</key>
<array>
<dict>
<key>UTTypeIdentifier</key>
<string>world.gridcoin.paymentrequest</string>
<key>UTTypeDescription</key>
<string>Gridcoin payment request</string>
<key>UTTypeConformsTo</key>
<array>
<string>public.data</string>
</array>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.mime-type</key>
<string>application/x-gridcoin-payment-request</string>
<key>public.filename-extension</key>
<array>
<string>gridcoinpaymentrequest</string>
</array>
</dict>
</dict>
</array>

<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>LSItemContentTypes</key>
<array>
<string>world.gridcoin.paymentrequest</string>
</array>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
</array>

<key>NSPrincipalClass</key>
<string>NSApplication</string>

<key>NSHighResolutionCapable</key>
<string>True</string>

<key>LSApplicationCategoryType</key>
<string>public.app-category.finance</string>

<key>NSRequiresAquaSystemAppearance</key>
<string>@QT_MACOS_DISABLE_DARK_MODE@</string>
</dict>
</plist>
2 changes: 2 additions & 0 deletions src/Makefile.qt.include
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ QT_MOC_CPP = \
qt/moc_bitcoinaddressvalidator.cpp \
qt/moc_bitcoinamountfield.cpp \
qt/moc_bitcoingui.cpp \
qt/moc_bitcoinunits.cpp \
qt/moc_clicklabel.cpp \
qt/moc_clientmodel.cpp \
qt/moc_coincontroldialog.cpp \
Expand Down Expand Up @@ -173,6 +174,7 @@ QT_MOC_CPP = \
qt/moc_transactiontablemodel.cpp \
qt/moc_transactionview.cpp \
qt/moc_updatedialog.cpp \
qt/moc_upgradeqt.cpp \
qt/moc_walletmodel.cpp \
qt/researcher/moc_projecttablemodel.cpp \
qt/researcher/moc_researchermodel.cpp \
Expand Down
38 changes: 27 additions & 11 deletions src/qt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -141,14 +141,21 @@ set_source_files_properties(
# =================

target_link_libraries(gridcoinqt PUBLIC
Qt5::Concurrent
Qt5::Core
Qt5::Gui
Qt5::Network
Qt5::Widgets
${QT}::Core
${QT}::Concurrent
${QT}::Gui
${QT}::Network
${QT}::Widgets
gridcoin_util
)

if(USE_QT6)
target_link_libraries(gridcoinqt PUBLIC ${QT}::Core5Compat)
endif()
if(USE_DBUS)
target_link_libraries(gridcoinqt PUBLIC ${QT}::DBus)
endif()

if(APPLE)
target_link_libraries(gridcoinqt PUBLIC
"-framework Foundation"
Expand All @@ -160,10 +167,7 @@ elseif(WIN32)
endif()

target_compile_definitions(gridcoinqt PUBLIC HAVE_CONFIG_H)

if(USE_DBUS)
target_link_libraries(gridcoinqt PUBLIC Qt5::DBus)
endif()
target_compile_definitions(gridcoinqt PUBLIC QT_DISABLE_DEPRECATED_UP_TO=0x050F00)

if(ENABLE_UPNP)
if(DEFAULT_UPNP)
Expand All @@ -179,15 +183,27 @@ add_dependencies(gridcoinqt gridcoinqt_l10n)
# Application
# ===========

add_executable(gridcoinresearch WIN32 MACOSX_BUNDLE bitcoin.cpp)
add_executable(gridcoinresearch bitcoin.cpp)

set(MACOSX_BUNDLE_RESOURCE_FILES res/icons/gridcoin.icns)
if(APPLE)
target_sources(gridcoinresearch PRIVATE ${MACOSX_BUNDLE_RESOURCE_FILES})
endif()

target_link_libraries(gridcoinresearch PRIVATE
${RUNTIME_LIBS}
Qt5::Widgets
${QT}::Widgets
gridcoin_util
gridcoinqt
)

set_target_properties(gridcoinresearch PROPERTIES
WIN32_EXECUTABLE TRUE
MACOSX_BUNDLE TRUE
MACOSX_BUNDLE_INFO_PLIST "${CMAKE_SOURCE_DIR}/share/qt/Info.plist.cmake.in"
RESOURCE ${MACOSX_BUNDLE_RESOURCE_FILES}
)

if(UNIX AND NOT APPLE)
include(GNUInstallDirs)
install(TARGETS gridcoinresearch
Expand Down
Loading
Loading