diff --git a/3rdparty/CMakeLists.txt b/3rdparty/CMakeLists.txt index ae88f8fbc..d054f147b 100644 --- a/3rdparty/CMakeLists.txt +++ b/3rdparty/CMakeLists.txt @@ -1,74 +1,81 @@ project (kmymoney-and-all-its-deps) # # Build all dependencies for KMyMoney and finally KMyMoney itself. # Parameters: EXTERNALS_DOWNLOAD_DIR place to download all packages # INSTALL_ROOT place to install everything to # # Example usage: cmake ..\kmymoneydep -DEXTERNALS_DOWNLOAD_DIR=/dev2/d -DINSTALL_ROOT=/dev2/i cmake_minimum_required(VERSION 2.8.6) if(NOT SUBMAKE_JOBS) set(SUBMAKE_JOBS 1) endif() if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) message(FATAL_ERROR "Compiling in the source directory is not supported. Use for example 'mkdir build; cd build; cmake ..'.") endif (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) # Tools must be obtained to work with: include (ExternalProject) # allow specification of a directory with pre-downloaded # requirements if(NOT IS_DIRECTORY ${EXTERNALS_DOWNLOAD_DIR}) message(FATAL_ERROR "No externals download dir set. Use -DEXTERNALS_DOWNLOAD_DIR") endif() if(NOT IS_DIRECTORY ${INSTALL_ROOT}) message(FATAL_ERROR "No install dir set. Use -DINSTALL_ROOT") endif() set(TOP_INST_DIR ${INSTALL_ROOT}) set(EXTPREFIX "${TOP_INST_DIR}") set(CMAKE_PREFIX_PATH "${EXTPREFIX}") message( STATUS "CMAKE_GENERATOR: ${CMAKE_GENERATOR}") set(GLOBAL_BUILD_TYPE RelWithDebInfo) set(GLOBAL_PROFILE ${GLOBAL_PROFILE} -DBUILD_TESTING=false) set(SECURITY_EXE_LINKER_FLAGS "") set(SECURITY_SHARED_LINKER_FLAGS "") set(SECURITY_MODULE_LINKER_FLAGS "") if (DEFINED EP_PREFIX) set_directory_properties(PROPERTIES EP_PREFIX ${EP_PREFIX}) endif () if (UNIX AND NOT APPLE) set(LINUX true) set(PATCH_COMMAND patch) endif () # this list must be dependency-ordered add_subdirectory( ext_iconv ) add_subdirectory( ext_gettext ) add_subdirectory( ext_zlib ) add_subdirectory( ext_boost ) add_subdirectory( ext_png ) add_subdirectory( ext_icu ) add_subdirectory( ext_xml ) add_subdirectory( ext_xslt ) add_subdirectory( ext_lzma ) add_subdirectory( ext_fontconfig) add_subdirectory( ext_freetype) add_subdirectory( ext_qt ) add_subdirectory( ext_phonon ) add_subdirectory( ext_frameworks ) add_subdirectory( ext_gmp ) add_subdirectory( ext_alkimia ) add_subdirectory( ext_kdiagram ) +# add_subdirectory( ext_ktoblzcheck ) +# add_subdirectory( ext_gwenhywfar ) +# add_subdirectory( ext_xmlsec1 ) +# add_subdirectory( ext_aqbanking ) +add_subdirectory( ext_gpgerror ) +add_subdirectory( ext_assuan2 ) +add_subdirectory( ext_gpgme ) diff --git a/3rdparty/ext_aqbanking/CMakeLists.txt b/3rdparty/ext_aqbanking/CMakeLists.txt new file mode 100644 index 000000000..4ed8cfc25 --- /dev/null +++ b/3rdparty/ext_aqbanking/CMakeLists.txt @@ -0,0 +1,17 @@ +SET(PREFIX_ext_aqbanking "${EXTPREFIX}" ) + +ExternalProject_Add( + ext_aqbanking + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} + URL https://www.aquamaniac.de/sites/download/download.php?package=03&release=217&file=02&dummy=aqbanking-5.7.8.tar.gz + URL_MD5 6aceeaad3a1000f22f08986e68946db3 + + INSTALL_DIR ${PREFIX_ext_aqbanking} + CONFIGURE_COMMAND ./configure --prefix=${PREFIX_ext_aqbanking} + BUILD_COMMAND make + INSTALL_COMMAND make install + + UPDATE_COMMAND "" + BUILD_IN_SOURCE 1 + DEPENDS ext_gwenhywfar ext_ktoblzcheck ext_xmlsec1 +) diff --git a/3rdparty/ext_assuan2/CMakeLists.txt b/3rdparty/ext_assuan2/CMakeLists.txt new file mode 100644 index 000000000..ee375dcb9 --- /dev/null +++ b/3rdparty/ext_assuan2/CMakeLists.txt @@ -0,0 +1,17 @@ +SET(PREFIX_ext_assuan2 "${EXTPREFIX}" ) + +ExternalProject_Add( + ext_assuan2 + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} + URL https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-2.5.1.tar.bz2 + URL_MD5 4354b7ae296894f232ada226a062d7d7 + + INSTALL_DIR ${PREFIX_ext_assuan2} + CONFIGURE_COMMAND ./configure --prefix=${PREFIX_ext_assuan2} + BUILD_COMMAND make + INSTALL_COMMAND make install + + UPDATE_COMMAND "" + BUILD_IN_SOURCE 1 + DEPENDS ext_gpgerror +) diff --git a/3rdparty/ext_gmp/CMakeLists.txt b/3rdparty/ext_gmp/CMakeLists.txt index 29a5bcec0..550af3e38 100644 --- a/3rdparty/ext_gmp/CMakeLists.txt +++ b/3rdparty/ext_gmp/CMakeLists.txt @@ -1,16 +1,16 @@ SET(PREFIX_ext_gmp "${EXTPREFIX}" ) ExternalProject_Add( ext_gmp DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} URL https://gmplib.org/download/gmp/gmp-6.1.2.tar.bz2 URL_MD5 8ddbb26dc3bd4e2302984debba1406a5 INSTALL_DIR ${PREFIX_ext_gmp} - CONFIGURE_COMMAND ./configure --prefix=${PREFIX_ext_gmp} + CONFIGURE_COMMAND ./configure --prefix=${PREFIX_ext_gmp} --enable-cxx BUILD_COMMAND make INSTALL_COMMAND make install UPDATE_COMMAND "" BUILD_IN_SOURCE 1 ) diff --git a/3rdparty/ext_gpgerror/CMakeLists.txt b/3rdparty/ext_gpgerror/CMakeLists.txt new file mode 100644 index 000000000..1c993ee56 --- /dev/null +++ b/3rdparty/ext_gpgerror/CMakeLists.txt @@ -0,0 +1,16 @@ +SET(PREFIX_ext_gpgerror "${EXTPREFIX}" ) + +ExternalProject_Add( + ext_gpgerror + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} + URL https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.32.tar.bz2 + URL_MD5 ef3d928a5a453fa701ecc3bb22be1c64 + + INSTALL_DIR ${PREFIX_ext_gpgerror} + CONFIGURE_COMMAND ./configure --prefix=${PREFIX_ext_gpgerror} + BUILD_COMMAND make + INSTALL_COMMAND make install + + UPDATE_COMMAND "" + BUILD_IN_SOURCE 1 +) diff --git a/3rdparty/ext_gpgme/CMakeLists.txt b/3rdparty/ext_gpgme/CMakeLists.txt new file mode 100644 index 000000000..d84b93b2a --- /dev/null +++ b/3rdparty/ext_gpgme/CMakeLists.txt @@ -0,0 +1,17 @@ +SET(PREFIX_ext_gpgme "${EXTPREFIX}" ) + +ExternalProject_Add( + ext_gpgme + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} + URL https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-1.11.1.tar.bz2 + URL_MD5 129c46fb85a7ffa41e43345e48aee884 + + INSTALL_DIR ${PREFIX_ext_gpgme} + CONFIGURE_COMMAND ./configure --prefix=${PREFIX_ext_gpgme} --enable-languages=cpp,qt --disable-gpg-test + BUILD_COMMAND make + INSTALL_COMMAND make install + + UPDATE_COMMAND "" + BUILD_IN_SOURCE 1 + DEPENDS ext_assuan2 +) diff --git a/3rdparty/ext_gwenhywfar/CMakeLists.txt b/3rdparty/ext_gwenhywfar/CMakeLists.txt new file mode 100644 index 000000000..e5944b3c7 --- /dev/null +++ b/3rdparty/ext_gwenhywfar/CMakeLists.txt @@ -0,0 +1,16 @@ +SET(PREFIX_ext_gwenhywfar "${EXTPREFIX}" ) + +ExternalProject_Add( + ext_gwenhywfar + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} + URL https://www.aquamaniac.de/sites/download/download.php?package=01&release=208&file=02&dummy=gwenhywfar-4.20.0.tar.gz + URL_MD5 0744255cae68adca6dff81d3a9f3932d + + INSTALL_DIR ${PREFIX_ext_gwenhywfar} + CONFIGURE_COMMAND ./configure --prefix=${PREFIX_ext_gwenhywfar} --with-guis=qt5 --disable-static --enable-shared --disable-binreloc + BUILD_COMMAND make + INSTALL_COMMAND make install + + UPDATE_COMMAND "" + BUILD_IN_SOURCE 1 +) diff --git a/3rdparty/ext_ktoblzcheck/CMakeLists.txt b/3rdparty/ext_ktoblzcheck/CMakeLists.txt new file mode 100644 index 000000000..4779dc032 --- /dev/null +++ b/3rdparty/ext_ktoblzcheck/CMakeLists.txt @@ -0,0 +1,16 @@ +SET(PREFIX_ext_ktoblzcheck "${EXTPREFIX}" ) + +ExternalProject_Add( + ext_ktoblzcheck + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} + URL http://downloads.sourceforge.net/project/ktoblzcheck/ktoblzcheck-1.49.tar.gz + URL_MD5 2ea1b01a931eb1e52b0ca0e07cb72435 + + INSTALL_DIR ${PREFIX_ext_ktoblzcheck} + CONFIGURE_COMMAND ./configure --prefix=${PREFIX_ext_ktoblzcheck} + BUILD_COMMAND make + INSTALL_COMMAND make install + + UPDATE_COMMAND "" + BUILD_IN_SOURCE 1 +) diff --git a/3rdparty/ext_xmlsec1/CMakeLists.txt b/3rdparty/ext_xmlsec1/CMakeLists.txt new file mode 100644 index 000000000..0ed9939df --- /dev/null +++ b/3rdparty/ext_xmlsec1/CMakeLists.txt @@ -0,0 +1,17 @@ +SET(PREFIX_ext_xmlsec1 "${EXTPREFIX}" ) + +ExternalProject_Add( + ext_xmlsec1 + DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR} + URL https://www.aleksey.com/xmlsec/download/xmlsec1-1.2.25.tar.gz + URL_MD5 dbbef1efc69e61bc4629650205a05b41 + + INSTALL_DIR ${PREFIX_ext_xmlsec1} + CONFIGURE_COMMAND ./configure --prefix=${PREFIX_ext_xmlsec1} --enable-shared --disable-static --without-openssl --disable-crypto-dl + BUILD_COMMAND make + INSTALL_COMMAND make install + + UPDATE_COMMAND "" + BUILD_IN_SOURCE 1 + DEPENDS ext_xslt +) diff --git a/CMakeLists.txt b/CMakeLists.txt index d6373646a..76038a8ab 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,379 +1,379 @@ # The CMake version we require cmake_minimum_required(VERSION 3.1) # Setting the name of the main project project(KMyMoney VERSION "5.0.80" LANGUAGES CXX) # Determine the GIT reference (if we're based on GIT) if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git") execute_process(COMMAND git rev-parse --short HEAD WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" OUTPUT_VARIABLE VERSION_SUFFIX OUTPUT_STRIP_TRAILING_WHITESPACE) set(VERSION_SUFFIX "-${VERSION_SUFFIX}") # Add variables which are similar to the build in names of cmake set(PROJECT_VERSION_SUFFIX "${VERSION_SUFFIX}") set(${PROJECT_NAME}_VERSION_SUFFIX "${VERSION_SUFFIX}") endif() # Automoc all sources set(CMAKE_AUTOMOC TRUE) list(APPEND CMAKE_AUTOMOC_MACRO_NAMES "K_PLUGIN_FACTORY" "K_PLUGIN_FACTORY_WITH_JSON") if (POLICY CMP0063) cmake_policy(SET CMP0063 NEW) # Policy introduced in CMake version 3.3 endif() if (POLICY CMP0071) # We do not require the old behaviour. It is only set to old, to prevent accidential use of # the new behavour. If the new behaviour becomes important, cmake_minimum_required has to be # set to "3.10". cmake_policy(SET CMP0071 OLD) # Policy introduced in CMake version 3.10 endif() ######################### General Requirements ########################## if (CMAKE_COMPILER_IS_GNUCXX AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 5.4.0) message(FATAL_ERROR "This version of KMyMoney requires at least gcc 5.4.0 to be built successfully") endif() find_package(ECM 5.10 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules) include(KDEInstallDirs) include(KDECMakeSettings) include(FeatureSummary) include(CMakeDependentOption) include(GenerateExportHeader) include(KMyMoneyMacros) find_package(PkgConfig) set (OPT_KF5_COMPONENTS DocTools Holidays Contacts Akonadi IdentityManagement Activities) find_package(Gpgmepp) if (Gpgmepp_FOUND) set(GPG_ENCRYPTION ON) else() set(GPG_ENCRYPTION OFF) list(APPEND OPT_KF5_COMPONENTS Gpgmepp) endif() if (PkgConfig_FOUND) pkg_check_modules(SQLCIPHER sqlcipher) endif() find_package(Qt5 5.6 REQUIRED COMPONENTS Core DBus Widgets Svg Xml Test PrintSupport OPTIONAL_COMPONENTS Sql Concurrent QuickWidgets) find_package(KF5 5.2 REQUIRED COMPONENTS Archive CoreAddons Config ConfigWidgets I18n Completion KCMUtils ItemModels ItemViews Service Wallet IconThemes XmlGui TextWidgets Notifications KIO OPTIONAL_COMPONENTS ${OPT_KF5_COMPONENTS} ) find_package(LibAlkimia5 7.0.0 REQUIRED) # Recent changes to LibAlkimia should allow us to remove this construct #if(CMAKE_SYSTEM_NAME MATCHES "Windows") # include_directories(${GMP_INCLUDE_DIR}) #endif() find_package(KChart 2.6.0 REQUIRED) if(KF5Gpgmepp_FOUND) set(GPG_ENCRYPTION ON) add_definitions(-DGpgmepp_FOUND) endif() add_feature_info("Encryption" GPG_ENCRYPTION "It allows encrypting your financial data.") add_definitions(-DQT_USE_QSTRINGBUILDER -DQT_NO_CAST_TO_ASCII -DQT_NO_URL_CAST_FROM_STRING) set(CMAKE_CXX_STANDARD 14) set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_EXTENSIONS OFF) # use DBus only on Linux if(CMAKE_SYSTEM_NAME MATCHES "Linux") set(KMM_DBUS 1) endif() set(CMAKE_INCLUDE_CURRENT_DIR ON) include_directories(${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}) # check for Doxygen find_package(Doxygen) if(DOXYGEN_FOUND) set(APIDOC_DIR ${CMAKE_CURRENT_BINARY_DIR}/apidocs) make_directory("${APIDOC_DIR}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/kmymoney.doxygen.in ${CMAKE_CURRENT_BINARY_DIR}/kmymoney.doxygen IMMEDIATE) add_custom_target(apidoc "${DOXYGEN}" "${CMAKE_CURRENT_BINARY_DIR}/kmymoney.doxygen") endif(DOXYGEN_FOUND) add_feature_info("Doxygen" DOXYGEN_FOUND "Generate API documentation with Doxygen (for devs only).") # check some include files exists set(CMAKE_REQUIRED_DEFINITIONS -D_XOPEN_SOURCE=500 -D_BSD_SOURCE) include (CheckIncludeFileCXX) check_include_file_cxx("unistd.h" HAVE_UNISTD_H) check_include_file_cxx("pwd.h" HAVE_PWD_H) check_include_file_cxx("windows.h" HAVE_WINDOWS_H) check_include_file_cxx("lmcons.h" HAVE_LMCONS_H) check_include_file_cxx("process.h" HAVE_PROCESS_H) # include check for members in structs include (CheckStructHasMember) ######################### Special Requirements ########################## # This is needed for QtSqlite and QtDesigner # (they'll install files to ${QT_INSTALL_DIR}/plugins/) get_filename_component(QT_BIN_DIR "${QT_MOC_EXECUTABLE}" PATH) get_filename_component(QT_DIR ${QT_BIN_DIR} PATH) set(QT_INSTALL_DIR ${QT_DIR} CACHE PATH "Qt install prefix defaults to the Qt prefix: ${QT_DIR}") if(KF5IdentityManagement_FOUND AND KF5Akonadi_FOUND AND KF5Contacts_FOUND) set(KMM_ADDRESSBOOK_FOUND true) endif() add_feature_info("Address book" KMM_ADDRESSBOOK_FOUND "It allows fetching payee information from KDE PIM system.") add_feature_info("Holidays" KF5Holidays_FOUND "It allows fetching holidays from KDE PIM system.") option(ENABLE_FORECASTVIEW "Enable forecast view" ON) add_feature_info("Forecast view" ENABLE_FORECASTVIEW "It adds possibility to calculate forecasts.") option(ENABLE_REPORTSVIEW "Enable reports view" ON) add_feature_info("Reports view" ENABLE_REPORTSVIEW "It adds possibility to display chart and table reports.") option(ENABLE_BUDGETVIEW "Enable budget view" ON) add_feature_info("Budget view" ENABLE_BUDGETVIEW "It adds possibility to plan a budget.") option(ENABLE_ONLINEJOBOUTBOXVIEW "Enable online job outbox view" ON) add_feature_info("Online job outbox view" ENABLE_ONLINEJOBOUTBOXVIEW "It adds outbox for sending online jobs.") cmake_dependent_option(ENABLE_SQLSTORAGE "Enable SQL storage support." ON "Qt5Sql_FOUND" OFF) add_feature_info("SQL Storage" ENABLE_SQLSTORAGE "It allows storing your financial data in SQL database.") cmake_dependent_option(ENABLE_SQLCIPHER "Enable SQLCipher support." ON "SQLCIPHER_FOUND" OFF) # Otherwise compilers halt on something like that: # ld: library not found for -lsqlcipher # on MS Windows, FreeBSD, and macOS. if(ENABLE_SQLCIPHER AND NOT CMAKE_SYSTEM_NAME MATCHES "Linux") link_directories(${SQLCIPHER_LIBRARY_DIRS}) endif() add_feature_info("SQLCipher" ENABLE_SQLCIPHER "It allows encrypting your SQLite3 database.") cmake_dependent_option(ENABLE_IBANBICDATA "Enable IBAN/BIC data support." OFF "Qt5Sql_FOUND" OFF) add_feature_info("IBAN/BIC data" ENABLE_IBANBICDATA "Adds predefined IBAN/BIC numbers to KMyMoney (note: doesn't work yet).") # check for optional QWebEngine option(ENABLE_WEBENGINE "Enable QWebEngine" OFF) if(ENABLE_WEBENGINE) find_package(Qt5WebEngineWidgets 5.8 REQUIRED) if(Qt5WebEngineWidgets_VERSION VERSION_GREATER 5.8.99 AND Qt5WebEngineWidgets_VERSION VERSION_LESS 5.9.3) message(WARNING "QWebEngine version ${Qt5WebEngineWidgets_VERSION} is known to be unstable with KMyMoney") endif() else(ENABLE_WEBENGINE) find_package(KF5WebKit REQUIRED) endif(ENABLE_WEBENGINE) # check for optional LibOFX support find_package(LibOfx) cmake_dependent_option(ENABLE_OFXIMPORTER "Enable OFX Importer" ON "LIBOFX_FOUND" OFF) if(ENABLE_OFXIMPORTER) if(NOT LIBOFX_HAVE_CLIENTUID) set(PATH_TO_LIBOFX_HEADER "${LIBOFX_INCLUDE_DIR}/libofx/libofx.h") unset(LIBOFX_HAVE_CLIENTUID) unset(LIBOFX_HAVE_CLIENTUID CACHE) #not doing this will prevent updating below check check_struct_has_member("struct OfxFiLogin" clientuid ${PATH_TO_LIBOFX_HEADER} LIBOFX_HAVE_CLIENTUID LANGUAGE CXX) endif() if (LIBOFX_HAVE_CLIENTUID) set (nice_LIBOFX_HAVE_CLIENTUID "yes") else() set (nice_LIBOFX_HAVE_CLIENTUID "no") endif() else() set (nice_LIBOFX_HAVE_CLIENTUID "unknown") unset(LIBOFX_HAVE_CLIENTUID) unset(LIBOFX_HAVE_CLIENTUID CACHE) endif(ENABLE_OFXIMPORTER) add_feature_info("OFX Importer" ENABLE_OFXIMPORTER "It allows importing OFX files (have client uid version: ${nice_LIBOFX_HAVE_CLIENTUID})" ) # check for optional KBanking support find_package(AQBANKING 5.6.5) find_package(gwenhywfar 4.15.3) find_package(gwengui-cpp) find_package(gwengui-qt5) cmake_dependent_option(ENABLE_KBANKING "Enable KBanking plugin" ON "AQBANKING_FOUND;gwengui-cpp_FOUND;gwengui-qt5_FOUND;Qt5QuickWidgets_FOUND" OFF) add_feature_info(KBanking ENABLE_KBANKING "Interface for the following online banking protocols: HBCI, EBICS, OFX Direct Connect, Paypal") # check for optional Weboob support set(Python_ADDITIONAL_VERSIONS 2.7 2.6) find_package(PythonInterp 2.6) find_package(PythonLibs ${PYTHON_VERSION_STRING}) if(PYTHONINTERP_FOUND AND PYTHONLIBS_FOUND) if(NOT PYTHON_VERSION_MAJOR VERSION_LESS 3) unset(PYTHONLIBS_FOUND) unset(PYTHONINTERP_FOUND) message(WARNING "Python 2 required, but Python 3 found.") else() include(FindPythonModule) find_python_module(weboob REQUIRED) endif() endif() cmake_dependent_option(ENABLE_WEBOOB "Enable Weboob plugin" ON "PYTHONLIBS_FOUND;PYTHONINTERP_FOUND;PY_WEBOOB;Qt5Concurrent_FOUND" OFF) add_feature_info(Weboob ENABLE_WEBOOB "Online banking interface using Weboob.") # check for optional ical support find_package(Libical) cmake_dependent_option(ENABLE_LIBICAL "Enable Calendar plugin" ON "LIBICAL_FOUND" OFF) add_feature_info(iCalendar ENABLE_LIBICAL "iCalendar integration.") option(ENABLE_QIFIMPORTER "Enable QIF Importer" ON) option(ENABLE_QIFEXPORTER "Enable QIF Exporter" ON) add_feature_info("QIF Importer" ENABLE_QIFIMPORTER "It allows importing QIF files.") add_feature_info("QIF Exporter" ENABLE_QIFEXPORTER "It allows exporting QIF files.") option(ENABLE_GNCIMPORTER "Enable GNC Importer" ON) add_feature_info("GNC Importer" ENABLE_GNCIMPORTER "It allows importing GNUCash files.") option(ENABLE_CSVIMPORTER "Enable CSV Importer" ON) option(ENABLE_CSVEXPORTER "Enable CSV Exporter" ON) add_feature_info("CSV Importer" ENABLE_CSVIMPORTER "It allows importing CSV files.") add_feature_info("CSV Exporter" ENABLE_CSVEXPORTER "It allows exporting CSV files.") option(ENABLE_UNFINISHEDFEATURES "For devs only" OFF) # TODO: this should be removed enable_testing() ######################### Settings ########################## # If no build type is set, use "Release with Debug Info" if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE RelWithDebInfo) endif(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Choose the type of build. Possible values are: 'Release' 'RelWithDebInfo' 'Debug' 'DebugKMM' 'Debugfull' 'Profile' The default value is: 'RelWithDebInfo'" FORCE) # tells gcc to enable exception handling include(KDECompilerSettings) kde_enable_exceptions() # Set linker flags # There is no way to detect linker in cmake (see https://gitlab.kitware.com/cmake/cmake/issues/17596) # and linkers aren't compatible with each other, so we need to assume something if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-dead_strip -Wl,-undefined,error") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-dead_strip -Wl,-undefined,error -Wl,-mark_dead_strippable_dylib") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip -Wl,-undefined,error") elseif(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--as-needed") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--as-needed") # TODO: remove multiple definitions of payeeIdentifierLoader::createPayeeIdentifierFromSqlDatabase set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--as-needed -Wl,--allow-multiple-definition") # CI builds are crashing on FreeBSD with --no-undefined. Probably because -DECM_ENABLE_SANITIZERS='address' # more can be read on the following site https://bugs.freedesktop.org/show_bug.cgi?id=100120 if(NOT CMAKE_SYSTEM_NAME MATCHES "FreeBSD") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined") endif() # TODO: remove multiple definitions of payeeIdentifierLoader::hasItemEditDelegate if(CMAKE_SYSTEM_NAME MATCHES "Windows") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--allow-multiple-definition") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--allow-multiple-definition") endif() elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /FORCE:Multiple") endif() # Set compiler flags if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wlogical-op -Wnull-dereference -Wshadow -Wunused -Wmisleading-indentation -Wsuggest-override -Wcast-qual -Wformat=2 -fno-common") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wlogical-op -Wno-null-dereference -Wshadow -Wunused -Wno-misleading-indentation -Wsuggest-override -Wcast-qual -Wformat=2 -fno-common") elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wcast-qual -Wformat=2 -Wunreachable-code -fno-common") elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /experimental:external /external:anglebrackets /external:W0 /W3") endif() # IDEA: Set on a per target base set(CMAKE_POSITION_INDEPENDENT_CODE ON) if(CMAKE_CXX_COMPILER_ID MATCHES "GNU" OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR CMAKE_CXX_COMPILER_ID MATCHES "AppleClang") # DebugKMM, Debugfull, Profile set(CMAKE_CXX_FLAGS_DEBUGKMM "-g -O2 -fno-reorder-blocks -fno-schedule-insns -fno-inline") set(CMAKE_CXX_FLAGS_DEBUGFULL "-g3 -fno-inline") set(CMAKE_CXX_FLAGS_PROFILE "-g3 -fno-inline -ftest-coverage -fprofile-arcs") # preprocessor definitions in case this is a debug build set(CMAKE_CXX_FLAGS_DEBUGFULL "${CMAKE_CXX_FLAGS_DEBUGFULL} -DQT_STRICT_ITERATORS -DKMM_DEBUG -DQT_FORCE_ASSERTS") set(CMAKE_CXX_FLAGS_DEBUGKMM "${CMAKE_CXX_FLAGS_DEBUGFULL} -DKMM_DEBUG -DQT_FORCE_ASSERTS") endif() option(USE_MODELTEST "Compile with ModelTest code (default=OFF)" OFF) add_feature_info("Model test" USE_MODELTEST "Generate modeltest code (for devs only).") option(USE_QT_DESIGNER "Install KMyMoney specific widget library for Qt-Designer (default=OFF)" OFF) add_feature_info("QtDesigner" USE_QT_DESIGNER "Qt-Designer library support (for devs only).") ######################### The Actual Targets ########################## add_subdirectory( tools ) add_subdirectory( kmymoney ) if(KF5DocTools_FOUND) add_subdirectory( doc ) endif() ######################### Output Results ############################# # create the config.h file out of the config.h.cmake configure_file("config-kmymoney.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config-kmymoney.h") configure_file("config-kmymoney-version.h.cmake" "${CMAKE_CURRENT_BINARY_DIR}/config-kmymoney-version.h") message(" Build type: ${CMAKE_BUILD_TYPE}") feature_summary(WHAT REQUIRED_PACKAGES_NOT_FOUND DESCRIPTION "The following REQUIRED packages have not been found:") feature_summary(WHAT OPTIONAL_PACKAGES_NOT_FOUND DESCRIPTION "The following OPTIONAL packages have not been found:") feature_summary(WHAT ENABLED_FEATURES DESCRIPTION "The following features have been enabled:") feature_summary(WHAT DISABLED_FEATURES DESCRIPTION "The following features have been disabled:") diff --git a/packaging/linux/appimage/build-deps.sh b/packaging/linux/appimage/build-deps.sh index cf2a1561b..e9ad662db 100755 --- a/packaging/linux/appimage/build-deps.sh +++ b/packaging/linux/appimage/build-deps.sh @@ -1,79 +1,83 @@ #!/bin/bash # # Build all KMyMoney's dependencies on Ubuntu 14.04. # # Prerequisites: cmake git build-essential libxcb-keysyms1-dev plus all deps for Qt5 # # Halt on errors and be verbose about what we are doing set -e set -x # Read in our parameters export BUILD_PREFIX=$1 export KMYMONEY_SOURCES=$2 # qjsonparser, used to add metadata to the plugins needs to work in a en_US.UTF-8 environment. # That's not always the case, so make sure it is export LC_ALL=en_US.UTF-8 export LANG=en_us.UTF-8 # We want to use $prefix/deps/usr/ for all our dependencies export DEPS_INSTALL_PREFIX=$BUILD_PREFIX/deps/usr/ export DOWNLOADS_DIR=$BUILD_PREFIX/downloads/ # Setup variables needed to help everything find what we build export LD_LIBRARY_PATH=$DEPS_INSTALL_PREFIX/lib:$LD_LIBRARY_PATH export PATH=$DEPS_INSTALL_PREFIX/bin:$PATH export PKG_CONFIG_PATH=$DEPS_INSTALL_PREFIX/share/pkgconfig:$DEPS_INSTALL_PREFIX/lib/pkgconfig:/usr/lib/pkgconfig:$PKG_CONFIG_PATH export CMAKE_PREFIX_PATH=$DEPS_INSTALL_PREFIX:$CMAKE_PREFIX_PATH # A kmymoney build layout looks like this: # kmymoney/ -- the source directory # downloads/ -- downloads of the dependencies from files.kde.org # deps-build/ -- build directory for the dependencies # deps/ -- the location for the built dependencies # build/ -- build directory for kmymoney itself # kmymoney.appdir/ -- install directory for kmymoney and the dependencies # Make sure our downloads directory exists if [ ! -d $DOWNLOADS_DIR ] ; then mkdir -p $DOWNLOADS_DIR fi # Make sure our build directory exists if [ ! -d $BUILD_PREFIX/deps-build/ ] ; then mkdir -p $BUILD_PREFIX/deps-build/ fi # The 3rdparty dependency handling in KMyMoney also requires the install directory to be pre-created if [ ! -d $DEPS_INSTALL_PREFIX ] ; then mkdir -p $DEPS_INSTALL_PREFIX fi # Switch to our build directory as we're basically ready to start building... cd $BUILD_PREFIX/deps-build/ # Configure the dependencies for building cmake $KMYMONEY_SOURCES/3rdparty -DCMAKE_INSTALL_PREFIX=$DEPS_INSTALL_PREFIX -DINSTALL_ROOT=$DEPS_INSTALL_PREFIX -DEXTERNALS_DOWNLOAD_DIR=$DOWNLOADS_DIR # Now start building everything we need, in the appropriate order # cmake --build . --config RelWithDebInfo --target ext_iconv # cmake --build . --config RelWithDebInfo --target ext_gettext # cmake --build . --config RelWithDebInfo --target ext_zlib cmake --build . --config RelWithDebInfo --target ext_boost # cmake --build . --config RelWithDebInfo --target ext_png # cmake --build . --config RelWithDebInfo --target ext_icu # cmake --build . --config RelWithDebInfo --target ext_xml # cmake --build . --config RelWithDebInfo --target ext_xslt # cmake --build . --config RelWithDebInfo --target ext_lzma # cmake --build . --config RelWithDebInfo --target ext_fontconfig # cmake --build . --config RelWithDebInfo --target ext_freetype cmake --build . --config RelWithDebInfo --target ext_qt cmake --build . --config RelWithDebInfo --target ext_knotifications cmake --build . --config RelWithDebInfo --target ext_kio cmake --build . --config RelWithDebInfo --target ext_kcmutils cmake --build . --config RelWithDebInfo --target ext_kwallet -# cmake --build . --config RelWithDebInfo --target ext_gmp +cmake --build . --config RelWithDebInfo --target ext_kitemmodels +cmake --build . --config RelWithDebInfo --target ext_gmp cmake --build . --config RelWithDebInfo --target ext_alkimia cmake --build . --config RelWithDebInfo --target ext_kdiagram +# cmake --build . --config RelWithDebInfo --target ext_aqbanking +cmake --build . --config RelWithDebInfo --target ext_gpgme +