Changeset View
Standalone View
src/qt/CMakeLists.txt
# Copyright (c) 2018 The Bitcoin developers | # Copyright (c) 2018 The Bitcoin developers | ||||
project(bitcoin-qt) | project(bitcoin-qt) | ||||
# This ensure that AUTOMOC doesn't run on generated files. | # This ensure that AUTOMOC doesn't run on generated files. | ||||
cmake_policy(SET CMP0071 OLD) | cmake_policy(SET CMP0071 OLD) | ||||
include(BrewHelper) | include(BrewHelper) | ||||
find_brew_prefix(QT5_PREFIX qt5) | find_brew_prefix(QT5_PREFIX qt5) | ||||
set(QT_REQUIRED_COMPONENTS Core Widgets Network Test) | set(QT_REQUIRED_COMPONENTS Core Widgets Network Test Gui) | ||||
find_package(Qt5 COMPONENTS ${QT_REQUIRED_COMPONENTS} REQUIRED HINTS "${QT5_PREFIX}") | find_package(Qt5 COMPONENTS ${QT_REQUIRED_COMPONENTS} REQUIRED HINTS "${QT5_PREFIX}") | ||||
# Find out more about Qt. This is similar to | # Find out more about Qt. This is similar to | ||||
# http://code.qt.io/cgit/qt/qtwebkit.git/tree/Source/cmake/OptionsQt.cmake | # http://code.qt.io/cgit/qt/qtwebkit.git/tree/Source/cmake/OptionsQt.cmake | ||||
get_target_property(QT_CORE_TYPE Qt5::Core TYPE) | get_target_property(QT_CORE_TYPE Qt5::Core TYPE) | ||||
if(QT_CORE_TYPE MATCHES STATIC) | if(QT_CORE_TYPE MATCHES STATIC) | ||||
set(QT_STATIC_BUILD ON) | set(QT_STATIC_BUILD ON) | ||||
endif() | endif() | ||||
▲ Show 20 Lines • Show All 125 Lines • ▼ Show 20 Lines | add_library(bitcoin-qt-base | ||||
# Handle qrc files | # Handle qrc files | ||||
${QRC_BITCOIN_CPP} | ${QRC_BITCOIN_CPP} | ||||
qrc_bitcoin_locale.cpp | qrc_bitcoin_locale.cpp | ||||
) | ) | ||||
# Windows support | # Windows support | ||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | if(${CMAKE_SYSTEM_NAME} MATCHES "Windows") | ||||
target_sources(bitcoin-qt-base PRIVATE winshutdownmonitor.cpp) | target_sources(bitcoin-qt-base PRIVATE winshutdownmonitor.cpp) | ||||
# Use windows platform plugin | |||||
target_compile_definitions(bitcoin-qt-base INTERFACE | |||||
-DQT_STATICPLUGIN=1 | |||||
-DQT_QPA_PLATFORM_WINDOWS=1 | |||||
deadalnix: Please do the same as configure instead. | |||||
) | |||||
find_library(_Qt5EventDispatcherSupport Qt5EventDispatcherSupport) | |||||
find_library(_Qt5FontDatabaseSupport Qt5FontDatabaseSupport) | |||||
find_library(_Qt5ThemeSupport Qt5ThemeSupport) | |||||
deadalnixUnsubmitted Not Done Inline ActionsQt should provide target for these with proper dependencies and all. deadalnix: Qt should provide target for these with proper dependencies and all. | |||||
FabienAuthorUnsubmitted Done Inline ActionsActually find_package searches for a Config.cmake suffix, and these files are only provided for high level modules. Fabien: Actually `find_package` searches for a `Config.cmake` suffix, and these files are only provided… | |||||
deadalnixUnsubmitted Not Done Inline ActionsQt should be able to set it's dependencies properly, or to provide target for these dependencies. deadalnix: Qt should be able to set it's dependencies properly, or to provide target for these… | |||||
FabienAuthorUnsubmitted Done Inline ActionsThere is no package nor config for these targets. Intended that we already use a script to parse the .prl files and convert them to cmake, I will use that to link the dependencies. Fabien: There is no package nor config for these targets.
What QT offers for these is a .prl file (for… | |||||
target_link_libraries(bitcoin-qt-base | |||||
Qt5::QWindowsIntegrationPlugin | |||||
${_Qt5EventDispatcherSupport} | |||||
${_Qt5FontDatabaseSupport} | |||||
${_Qt5ThemeSupport} | |||||
) | |||||
endif() | endif() | ||||
target_include_directories(bitcoin-qt-base | target_include_directories(bitcoin-qt-base | ||||
PUBLIC | PUBLIC | ||||
. | . | ||||
${CMAKE_CURRENT_BINARY_DIR} | ${CMAKE_CURRENT_BINARY_DIR} | ||||
${CMAKE_CURRENT_BINARY_DIR}/forms | ${CMAKE_CURRENT_BINARY_DIR}/forms | ||||
${Protobuf_INCLUDE_DIRS} | ${Protobuf_INCLUDE_DIRS} | ||||
) | ) | ||||
target_link_libraries(bitcoin-qt-base | target_link_libraries(bitcoin-qt-base | ||||
server | server | ||||
rpcclient | rpcclient | ||||
Qt5::Widgets | Qt5::Widgets | ||||
Qt5::Network | Qt5::Network | ||||
Qt5::Gui | |||||
OpenSSL::SSL | OpenSSL::SSL | ||||
${Protobuf_LIBRARIES} | ${Protobuf_LIBRARIES} | ||||
) | ) | ||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin") | ||||
set_property(TARGET bitcoin-qt-base PROPERTY AUTOMOC_MOC_OPTIONS "-DQ_OS_MAC") | set_property(TARGET bitcoin-qt-base PROPERTY AUTOMOC_MOC_OPTIONS "-DQ_OS_MAC") | ||||
endif() | endif() | ||||
▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines |
Please do the same as configure instead.