Files
pay/CMakeLists.txt
T

144 lines
5.0 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
# QtCreator supports the following variables for Android, which are identical to qmake Android variables.
# Check http://doc.qt.io/qt-5/deployment-android.html for more information.
# They need to be set before the find_package(Qt5 ...) call.
#if(ANDROID)
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
# if (ANDROID_ABI STREQUAL "armeabi-v7a")
# set(ANDROID_EXTRA_LIBS
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libcrypto.so
# ${CMAKE_CURRENT_SOURCE_DIR}/path/to/libssl.so)
# endif()
#endif()
2021-01-28 21:03:52 +01:00
find_package(Qt5 COMPONENTS Core Quick LinguistTools REQUIRED)
find_package(QREncode REQUIRED)
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_definitions(-DQT_NO_DEPRECATED_WARNINGS)
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
main.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
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
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-05-28 11:42:38 +02:00
if (EXISTS ${CMAKE_SOURCE_DIR}/data/blockheaders)
2021-11-10 23:17:32 +01:00
install(FILES ${CMAKE_SOURCE_DIR}/data/blockheaders DESTINATION share/floweepay)
2021-05-28 11:42:38 +02:00
endif()
2020-05-24 13:20:03 +02:00
if(ANDROID)
add_library(PAY SHARED
${PAY_SOURCES}
)
else()
2021-10-28 14:40:39 +02:00
set (TS_FILES
2021-01-28 21:03:52 +01:00
desktop/i18n/floweepay_nl.ts
2021-01-28 22:55:16 +01:00
desktop/i18n/floweepay_pl.ts
2021-01-28 21:03:52 +01:00
)
2021-10-28 14:40:39 +02:00
# set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "l10n")
qt5_add_translation(qmFiles ${TS_FILES})
# 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
2021-11-10 10:33:51 +01:00
COMMAND lupdate desktop/qml.qrc ${PAY_SOURCES} -ts ${TS_FILES} desktop/i18n/floweepay_en.ts
2021-10-28 14:40:39 +02:00
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMENT
"Updating internationalization (i18n) translation files"
)
2021-01-28 21:03:52 +01:00
# 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(desktop/i18n.qrc ${CMAKE_BINARY_DIR} COPYONLY)
2020-05-24 13:20:03 +02:00
add_executable(pay
${PAY_SOURCES}
2021-01-28 21:03:52 +01:00
${QM_FILES}
2020-05-24 13:20:03 +02:00
desktop/qml.qrc
2021-01-28 21:03:52 +01:00
i18n.qrc
2020-05-24 13:20:03 +02:00
)
2021-05-05 16:10:03 +02:00
install(PROGRAMS desktop/org.flowee.pay.desktop DESTINATION share/applications)
set (ICONIN desktop/icons/hicolor/)
set (ICONOUT share/icons/hicolor/)
2021-10-28 14:49:59 +02:00
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)
2020-05-24 13:20:03 +02:00
endif()
2021-10-28 14:49:59 +02:00
find_package(Boost 1.67.0
2020-05-24 13:20:03 +02:00
REQUIRED
filesystem chrono thread
)
find_package(OpenSSL REQUIRED)
message ("Using OpenSSL ${OPENSSL_VERSION}")
find_package(Flowee REQUIRED flowee_p2p)
target_compile_definitions(pay
PRIVATE $<$<OR:$<CONFIG:Debug>,$<CONFIG:RelWithDebInfo>>:QT_QML_DEBUG>)
target_link_libraries(pay
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
2020-10-17 16:38:37 +02:00
add_subdirectory(testing)
2021-10-28 14:49:59 +02:00
install(FILES ${CMAKE_SOURCE_DIR}/data/bip39-english DESTINATION share/floweepay)
install(TARGETS pay DESTINATION bin)