Files
pay/CMakeLists.txt
T

162 lines
5.5 KiB
CMake
Raw Permalink Normal View History

2020-05-24 13:20:03 +02:00
# This file is part of the Flowee project
2021-01-05 14:03:30 +01:00
# Copyright (C) 2020 Tom Zander <tom@flowee.org>
2020-05-24 13:20:03 +02:00
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
cmake_minimum_required(VERSION 3.5)
project(flowee_pay)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake)
2020-05-24 13:20:03 +02:00
2021-01-28 21:03:52 +01:00
find_package(Qt5 COMPONENTS Core Quick LinguistTools REQUIRED)
find_package(QREncode REQUIRED)
2021-11-20 22:20:08 +01:00
find_package(OpenSSL REQUIRED)
message ("Using OpenSSL ${OPENSSL_VERSION}")
find_package(Flowee REQUIRED flowee_p2p)
find_package(Boost 1.67.0
REQUIRED
filesystem chrono thread
)
2020-05-24 13:20:03 +02:00
option(local_qml "Allow local QML loading" OFF)
2020-05-24 13:20:03 +02:00
2021-04-29 15:53:16 +02:00
# starting with Qt5.15 we have a lot of deprecation warnings,
# likely to make porting to Qt6 easier.
# as long as we require linking to older Qt versions those warnings
# are clutter. Remove this define when we start porting to Qt6.
add_compile_definitions(QT_NO_DEPRECATED_WARNINGS)
2021-04-29 15:53:16 +02:00
2020-05-24 13:20:03 +02:00
set (PAY_SOURCES
2020-10-14 15:12:33 +02:00
AccountInfo.cpp
BitcoinValue.cpp
2020-05-24 13:20:03 +02:00
FloweePay.cpp
NetDataProvider.cpp
NetPeer.cpp
2021-10-25 19:42:13 +02:00
NewWalletConfig.cpp
2021-02-05 16:56:02 +01:00
NotificationManager.cpp
2020-10-14 15:12:33 +02:00
Payment.cpp
PaymentRequest.cpp
2021-11-23 17:45:38 +01:00
PaymentDetailOutput.cpp
PaymentDetailInputs.cpp
2020-05-24 13:20:03 +02:00
PortfolioDataProvider.cpp
2021-05-07 19:47:11 +02:00
PriceDataProvider.cpp
QRCreator.cpp
2020-12-17 23:12:39 +01:00
TransactionInfo.cpp
2020-05-24 13:20:03 +02:00
Wallet.cpp
2021-11-19 11:20:01 +01:00
WalletCoinsModel.cpp
2020-05-24 13:20:03 +02:00
WalletHistoryModel.cpp
2021-10-29 18:20:42 +02:00
WalletSecretsModel.cpp
Wallet_support.cpp
2021-10-29 12:48:12 +02:00
Wallet_spending.cpp
2020-05-24 13:20:03 +02:00
)
2021-11-20 22:20:08 +01:00
add_library(pay_lib STATIC
${PAY_SOURCES}
2020-05-24 13:20:03 +02:00
)
2021-11-20 22:20:08 +01:00
target_link_libraries(pay_lib
flowee_apputils
2020-05-26 20:25:07 +02:00
flowee_utils
2020-05-24 13:20:03 +02:00
flowee_p2p
${OPENSSL_LIBRARIES}
${Boost_LIBRARIES}
Qt5::Core Qt5::Quick ${QREncode_LIBRARIES})
2020-05-26 20:25:07 +02:00
#### Translations
2020-10-17 16:38:37 +02:00
set (TS_FILES_DESKTOP
2021-11-21 13:22:50 +01:00
translations/floweepay-desktop_en.ts
2021-11-23 11:18:47 +01:00
translations/floweepay-desktop_nl.ts
translations/floweepay-desktop_pl.ts
2021-11-20 22:20:08 +01:00
)
qt5_add_translation(qmFiles1 ${TS_FILES_DESKTOP})
set (TS_FILES_COMMON
2021-11-21 13:22:50 +01:00
translations/floweepay-common_en.ts
translations/floweepay-common_nl.ts
translations/floweepay-common_pl.ts
)
qt5_add_translation(qmFiles2 ${TS_FILES_COMMON})
set (TS_FILES_MOBILE
translations/floweepay-mobile_nl.ts
translations/floweepay-mobile_pl.ts
)
qt5_add_translation(qmFiles3 ${TS_FILES_MOBILE})
2020-10-17 16:38:37 +02:00
2021-11-20 22:20:08 +01:00
# notice that for this custom target we require CMake 3.13 minimum. But since
# only the release manager will need to call this, we leave the project cmake
# minimum to be lower.
add_custom_target(i18n
COMMAND lupdate desktop/qml.qrc -ts ${TS_FILES_DESKTOP} translations/floweepay-desktop.ts
COMMAND lupdate ${PAY_SOURCES} -ts ${TS_FILES_GENERIC} translations/floweepay-common.ts
COMMAND lupdate mobile/qml.qrc -ts ${TS_FILES_MOBILE} translations/floweepay-mobile.ts
2021-11-20 22:20:08 +01:00
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT
"Updating internationalization (i18n) translation files"
)
# The qm files are generated in the build tree, but the qrc file is inside the
# source directory and the path to resources are relative to the location of
# the qrc file itself. We use configure_file() to copy the qrc file in the build
# directory such that it can find the qm translations files. The qrc file is
# copied if it doesn't exist in the destination or if it is modified.
configure_file(translations/desktop-i18n.qrc ${CMAKE_BINARY_DIR} COPYONLY)
if (local_qml)
set (QML_PATH ${CMAKE_SOURCE_DIR}/desktop)
endif()
configure_file(qml_path_helper.cpp.in desktop/qml_path_helper.cpp)
2021-11-20 22:20:08 +01:00
add_executable(pay
main.cpp
desktop/qml_path_helper.cpp
2021-11-20 22:20:08 +01:00
desktop/qml.qrc
desktop-i18n.qrc
2021-11-20 22:20:08 +01:00
)
target_link_libraries(pay pay_lib)
2021-10-28 14:49:59 +02:00
install(TARGETS pay DESTINATION bin)
2021-11-20 22:20:08 +01:00
configure_file(translations/mobile-i18n.qrc ${CMAKE_BINARY_DIR} COPYONLY)
if (local_qml)
set (QML_PATH ${CMAKE_SOURCE_DIR}/mobile)
endif()
configure_file(qml_path_helper.cpp.in mobile/qml_path_helper.cpp)
add_executable(pay_mobile
main.cpp
mobile/qml_path_helper.cpp
mobile/qml.qrc
mobile-i18n.qrc
)
target_link_libraries(pay_mobile pay_lib)
install(TARGETS pay_mobile DESTINATION bin)
2021-11-20 22:20:08 +01:00
install(PROGRAMS desktop/org.flowee.pay.desktop DESTINATION share/applications)
set (ICONIN desktop/icons/hicolor/)
set (ICONOUT share/icons/hicolor/)
install(FILES ${ICONIN}16x16/apps/org.flowee.pay.png DESTINATION ${ICONOUT}16x16/apps)
install(FILES ${ICONIN}22x22/apps/org.flowee.pay.png DESTINATION ${ICONOUT}22x22/apps)
install(FILES ${ICONIN}24x24/apps/org.flowee.pay.png DESTINATION ${ICONOUT}24x24/apps)
install(FILES ${ICONIN}32x32/apps/org.flowee.pay.png DESTINATION ${ICONOUT}32x32/apps)
install(FILES ${ICONIN}48x48/apps/org.flowee.pay.png DESTINATION ${ICONOUT}48x48/apps)
install(FILES ${ICONIN}256x256/apps/org.flowee.pay.png DESTINATION ${ICONOUT}256x256/apps)
install(FILES ${CMAKE_SOURCE_DIR}/data/bip39-english DESTINATION share/floweepay)
if (EXISTS ${CMAKE_SOURCE_DIR}/data/blockheaders)
install(FILES ${CMAKE_SOURCE_DIR}/data/blockheaders DESTINATION share/floweepay)
endif()
add_subdirectory(testing)