diff --git a/CMakeLists.txt b/CMakeLists.txt index 281fe9d1..71e307a7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,227 +1,228 @@ if(POLICY CMP0048) cmake_policy(SET CMP0048 NEW) endif(POLICY CMP0048) project( kbibtex VERSION "0.9.50" ) cmake_minimum_required( VERSION 3.7.2 FATAL_ERROR ) set( QT_MIN_VERSION "5.9.0" ) set( KF5_MIN_VERSION "5.51.0" ) find_package(ECM 5.19 REQUIRED NO_MODULE) add_definitions( -DTRANSLATION_DOMAIN="kbibtex" -DHAVE_QTWIDGETS -DHAVE_KF5 -DHAVE_ICU ) set( CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ${CMAKE_MODULE_PATH} ) include(KDEInstallDirs) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings) +include(ECMGenerateHeaders) include(ECMInstallIcons) include(ECMSetupVersion) include(ECMAddAppIcon) include(GenerateExportHeader) find_package( Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Network XmlPatterns Concurrent NetworkAuth ) if (MSVC) MESSAGE( STATUS "Disabling building tests when using Microsoft Visual Studio C++ compiler" ) # Note to any developer: Try to enable building tests and see which issues you may encounter. # Examples may include: (1) char* texts which exceed the size limit supported by MSVC which # is about 2^16 bytes and (2) characters in strings written in \uXXXX notation not supported # in 1252 encoding as assumed by MSVC for C++ source files. SET(BUILD_TESTING OFF) endif (MSVC) if( BUILD_TESTING ) find_package( Qt5Test ${QT_MIN_VERSION} CONFIG REQUIRED ) if (WRITE_RAWDATAFILE) add_definitions(-DWRITE_RAWDATAFILE) endif(WRITE_RAWDATAFILE) set( TESTSET_DIRECTORY "" CACHE PATH "Directory where the local checkout of Git repository 'kbibtex-testset' is located" ) endif( BUILD_TESTING ) find_package( Qt5WebEngineWidgets ${QT_MIN_VERSION} QUIET CONFIG ) find_package( Qt5WebKitWidgets ${QT_MIN_VERSION} QUIET CONFIG ) find_package( KF5 ${KF5_MIN_VERSION} REQUIRED I18n XmlGui KIO IconThemes ItemViews Completion Parts CoreAddons Service Wallet Crash ) find_package(KF5DocTools) find_package(KF5TextEditor NO_MODULE) ecm_setup_version( PROJECT VARIABLE_PREFIX KBIBTEX SOVERSION ${KBIBTEX_VERSION_MAJOR} VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/kbibtex-version.h" ) if((${KBIBTEX_VERSION_PATCH} GREATER 50) OR (${KBIBTEX_VERSION_PATCH} EQUAL 50)) # If the version number indicates a pre-release version such as # '0.7.90', i.e. a beta version for the major release 0.8, # increment release version from 0.7 to 0.8 math(EXPR KBIBTEX_RELEASE_VERSION_MINOR "${KBIBTEX_VERSION_MINOR} + 1") set( KBIBTEX_RELEASE_VERSION ${KBIBTEX_VERSION_MAJOR}.${KBIBTEX_RELEASE_VERSION_MINOR} ) else((${KBIBTEX_VERSION_PATCH} GREATER 50) OR (${KBIBTEX_VERSION_PATCH} EQUAL 50)) set( KBIBTEX_RELEASE_VERSION ${KBIBTEX_VERSION_MAJOR}.${KBIBTEX_VERSION_MINOR} ) endif((${KBIBTEX_VERSION_PATCH} GREATER 50) OR (${KBIBTEX_VERSION_PATCH} EQUAL 50)) option( UNITY_BUILD "Compile multiple C++ files in one big, merged file (\"Unity build\")\nSee also http://t-fischer.dreamwidth.org/3054.html" ) if(UNITY_BUILD) message(STATUS "Unity build enabled") else(UNITY_BUILD) message(STATUS "Unity build disabled (default), use option UNITY_BUILD to enable it") endif(UNITY_BUILD) # # FIXME may have to be cleaned up a little bit # # Contributed by Jeremy Cribb # if( # APPLE # ) # find_library( # SYS_CONFIG_LIBRARY # SystemConfiguration # ) # mark_as_advanced( # SYS_CONFIG_LIBRARY # ) # # SET(TARGET_EXTERNAL_LIBRARIES iconv ${SYS_CONFIG_LIBRARY}) # set( # ICONV_INCLUDE_DIR # "/opt/local/include" # ) # set( # ICONV_LIBRARIES # "/opt/local/lib/libiconv.dylib" # ) # set( # LIBXSLT_LIBRARIES # "/opt/local/lib/libxslt.dylib" # ) # endif( # APPLE # ) find_package( Poppler REQUIRED COMPONENTS Qt5 ) find_package( ICU REQUIRED COMPONENTS uc i18n ) if( ICU_FOUND ) message( STATUS "Found ICU " ${ICU_VERSION} ) include_directories(${ICU_INCLUDE_DIRS}) endif( ICU_FOUND ) add_subdirectory( config ) add_subdirectory( src ) add_subdirectory( xslt ) add_subdirectory( mime ) if(KF5DocTools_FOUND) add_subdirectory(doc) endif() # macro_optional_add_subdirectory( # po # ) feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/mobile/sailfishos/bibsearch.pro b/mobile/sailfishos/bibsearch.pro index 34002cdf..65c84b7f 100644 --- a/mobile/sailfishos/bibsearch.pro +++ b/mobile/sailfishos/bibsearch.pro @@ -1,107 +1,107 @@ TARGET = harbour-bibsearch CONFIG += sailfishapp SOURCES += src/main.cpp src/searchenginelist.cpp \ src/bibliographymodel.cpp ../../src/data/value.cpp \ ../../src/data/entry.cpp ../../src/data/macro.cpp \ ../../src/data/comment.cpp ../../src/data/file.cpp \ ../../src/data/preamble.cpp ../../src/data/element.cpp \ ../../src/networking/internalnetworkaccessmanager.cpp \ ../../src/networking/onlinesearch/onlinesearchabstract.cpp \ ../../src/networking/onlinesearch/onlinesearchbibsonomy.cpp \ ../../src/networking/onlinesearch/onlinesearchacmportal.cpp \ ../../src/networking/onlinesearch/onlinesearchsciencedirect.cpp \ ../../src/networking/onlinesearch/onlinesearchgooglescholar.cpp \ ../../src/networking/onlinesearch/onlinesearchjstor.cpp \ ../../src/networking/onlinesearch/onlinesearchspringerlink.cpp \ ../../src/networking/onlinesearch/onlinesearchieeexplore.cpp \ ../../src/networking/onlinesearch/onlinesearcharxiv.cpp \ ../../src/networking/onlinesearch/onlinesearchingentaconnect.cpp \ ../../src/networking/onlinesearch/onlinesearchpubmed.cpp \ ../../src/global/preferences.cpp ../../src/global/kbibtex.cpp \ ../../src/io/encoderxml.cpp ../../src/io/encoder.cpp \ ../../src/io/encoderlatex.cpp \ ../../src/io/fileimporter.cpp \ ../../src/io/fileimporterbibtex.cpp \ ../../src/io/textencoder.cpp ../../src/io/xsltransform.cpp \ ../../src/config/bibtexfields.cpp \ ../../src/config/bibtexentries.cpp \ ../../src/config/logging_config.cpp \ ../../src/networking/logging_networking.cpp \ ../../src/data/logging_data.cpp ../../src/io/logging_io.cpp HEADERS += src/bibliographymodel.h src/searchenginelist.h \ src/kbibtexnamespace.h ../../src/data/entry.h \ ../../src/data/macro.h ../../src/data/comment.h \ ../../src/data/file.h ../../src/data/preamble.h \ ../../src/data/value.h ../../src/data/element.h \ ../../src/networking/internalnetworkaccessmanager.h \ ../../src/networking/onlinesearch/onlinesearchabstract.h \ ../../src/networking/onlinesearch/onlinesearchbibsonomy.h \ ../../src/networking/onlinesearch/onlinesearchacmportal.h \ ../../src/networking/onlinesearch/onlinesearchsciencedirect.h \ ../../src/networking/onlinesearch/onlinesearchgooglescholar.h \ ../../src/networking/onlinesearch/onlinesearchjstor.h \ ../../src/networking/onlinesearch/onlinesearcharxiv.h \ ../../src/networking/onlinesearch/onlinesearchingentaconnect.h \ ../../src/networking/onlinesearch/onlinesearchspringerlink.h \ ../../src/networking/onlinesearch/onlinesearchieeexplore.h \ ../../src/networking/onlinesearch/onlinesearchpubmed.h \ ../../src/global/preferences.h ../../src/global/kbibtex.h \ ../../src/io/encoderxml.h ../../src/io/encoder.h \ ../../src/io/encoderlatex.h ../../src/io/fileimporter.h \ ../../src/io/fileimporterbibtex.h \ ../../src/io/textencoder.h ../../src/io/xsltransform.h \ ../../src/config/bibtexfields.h ../../src/config/bibtexentries.h OTHER_FILES += qml/pages/SearchForm.qml qml/pages/EntryView.qml \ qml/pages/AboutPage.qml qml/pages/BibliographyListView.qml \ qml/cover/CoverPage.qml qml/BibSearch.qml \ qml/pages/AboutPage.qml qml/pages/SearchEngineListView.qml \ rpm/$${TARGET}.spec \ rpm/$${TARGET}.yaml \ translations/*.ts \ $${TARGET}.desktop RESOURCES += sailfishos_res.qrc QT += xmlpatterns -DEFINES += KBIBTEXCONFIG_EXPORT= KBIBTEXDATA_EXPORT= KBIBTEXIO_EXPORT= KBIBTEXNETWORKING_EXPORT= +DEFINES += KBIBTEXGLOBAL_EXPORT= KBIBTEXCONFIG_EXPORT= KBIBTEXDATA_EXPORT= KBIBTEXIO_EXPORT= KBIBTEXNETWORKING_EXPORT= -INCLUDEPATH += ../../src/data ../../src/networking ../../src/networking/onlinesearch ../../src/io ../../src/config ../../src/global +INCLUDEPATH += ../../src/global $${OUT_PWD}/src/global ../../src/data ../../src/networking ../../src/networking/onlinesearch ../../src/io ../../src/config CONFIG += sailfishapp_i18n sailfishapp_i18n_idbased TRANSLATIONS += \ translations/$${TARGET}-de.ts \ translations/$${TARGET}-en.ts DISTFILES += \ qml/pages/BibliographyListView.qml \ qml/pages/EntryView.qml \ qml/pages/SearchForm.qml \ qml/pages/SettingsPage.qml \ qml/pages/AboutPage.qml xslt.files = ../../xslt/pam2bibtex.xsl ../../xslt/ieeexploreapiv1-to-bibtex.xsl \ ../../xslt/arxiv2bibtex.xsl ../../xslt/pubmed2bibtex.xsl xslt.path = /usr/share/$${TARGET} INSTALLS += xslt icon86.files = icons/86/$${TARGET}.png icon86.path = /usr/share/icons/hicolor/86x86/apps/ INSTALLS += icon86 icon108.files = icons/108/$${TARGET}.png icon108.path = /usr/share/icons/hicolor/108x108/apps/ INSTALLS += icon108 icon128.files = icons/128/$${TARGET}.png icon128.path = /usr/share/icons/hicolor/128x128/apps/ INSTALLS += icon128 icon172.files = icons/172/$${TARGET}.png icon172.path = /usr/share/icons/hicolor/172x172/apps/ INSTALLS += icon172 icon256.files = icons/256/$${TARGET}.png icon256.path = /usr/share/icons/hicolor/256x256/apps/ INSTALLS += icon256 diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index cf6a39fd..860db12f 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,88 +1,89 @@ # "Unity build" found at # https://cheind.wordpress.com/2009/12/10/reducing-compilation-time-unity-builds/ function(enable_unity_build UB_SUFFIX SOURCE_VARIABLE_NAME) set(files ${${SOURCE_VARIABLE_NAME}}) # Generate a unique filename for the unity build translation unit set(unit_build_file ${CMAKE_CURRENT_BINARY_DIR}/ub_${UB_SUFFIX}.cpp) # Exclude all translation units from compilation set_source_files_properties(${files} PROPERTIES HEADER_FILE_ONLY true) # Open the ub file file(WRITE ${unit_build_file} "// Unity Build generated by CMake\n") # Add include statement for each translation unit foreach(source_file ${files}) file(APPEND ${unit_build_file} "#include <${source_file}>\n") endforeach(source_file) # Complement list of translation units with the name of ub set(${SOURCE_VARIABLE_NAME} ${${SOURCE_VARIABLE_NAME}} ${unit_build_file} PARENT_SCOPE) endfunction(enable_unity_build) if(Qt5WebEngineWidgets_FOUND) add_definitions( -DHAVE_WEBENGINEWIDGETS ) endif(Qt5WebEngineWidgets_FOUND) if(Qt5WebKitWidgets_FOUND) add_definitions( -DHAVE_WEBKITWIDGETS ) endif(Qt5WebKitWidgets_FOUND) if(Qt5WebEngineWidgets_FOUND) if(Qt5WebKitWidgets_FOUND) message(STATUS "Found both QtWebEngine and QtWebKit, preferring to use QtWebEngine") else(Qt5WebKitWidgets_FOUND) message(STATUS "Found QtWebEngine, but not QtWebKit, therefore going to use QtWebEngine") endif(Qt5WebKitWidgets_FOUND) else(Qt5WebEngineWidgets_FOUND) if(Qt5WebKitWidgets_FOUND) message(STATUS "Found QtWebKit, but not QtWebEngine, therefore going to use QtWebKit") else(Qt5WebKitWidgets_FOUND) message(STATUS "Found neither QtWebEngine nor QtWebKit, therefore trying to locate a KPart for HTML data") endif(Qt5WebKitWidgets_FOUND) endif(Qt5WebEngineWidgets_FOUND) +add_subdirectory(global) add_subdirectory( config ) add_subdirectory( data ) add_subdirectory( io ) add_subdirectory( processing ) add_subdirectory( networking ) add_subdirectory( gui ) add_subdirectory( program ) add_subdirectory( parts ) if( BUILD_TESTING ) add_subdirectory( test ) endif( BUILD_TESTING ) # install( # FILES # kbibtexnamespace.h # DESTINATION # ${INCLUDE_INSTALL_DIR}/kbibtex # COMPONENT # development # ) diff --git a/src/config/CMakeLists.txt b/src/config/CMakeLists.txt index edb8c18f..2e1a6a00 100644 --- a/src/config/CMakeLists.txt +++ b/src/config/CMakeLists.txt @@ -1,53 +1,50 @@ # KBibTeXConfig library set( kbibtexconfig_LIB_SRCS notificationhub.cpp bibtexentries.cpp bibtexfields.cpp preferences.cpp logging_config.cpp ) set( kbibtexconfig_HDRS notificationhub.h bibtexentries.h bibtexfields.h ) if(UNITY_BUILD) enable_unity_build(kbibtexconfig kbibtexconfig_LIB_SRCS) endif(UNITY_BUILD) -include_directories( - ${CMAKE_SOURCE_DIR}/src/global -) - add_library( kbibtexconfig SHARED ${kbibtexconfig_LIB_SRCS} ) target_link_libraries( kbibtexconfig Qt5::Core KF5::I18n KF5::XmlGui + kbibtexglobal ) set_target_properties( kbibtexconfig PROPERTIES EXPORT_NAME "kbibtexconfig" VERSION ${KBIBTEX_RELEASE_VERSION} SOVERSION ${KBIBTEX_SOVERSION} ) install( TARGETS kbibtexconfig ${INSTALL_TARGETS_DEFAULT_ARGS} ) generate_export_header( kbibtexconfig ) diff --git a/src/data/CMakeLists.txt b/src/data/CMakeLists.txt index e4bbd7ec..57d162ed 100644 --- a/src/data/CMakeLists.txt +++ b/src/data/CMakeLists.txt @@ -1,68 +1,66 @@ # KBibTeXData library set( kbibtexdata_LIB_SRCS comment.cpp element.cpp entry.cpp file.cpp macro.cpp preamble.cpp value.cpp models/filemodel.cpp - ${CMAKE_SOURCE_DIR}/src/global/kbibtex.cpp ${CMAKE_SOURCE_DIR}/src/config/preferences.cpp logging_data.cpp ) set( kbibtexdata_HDRS comment.h element.h entry.h file.h macro.h preamble.h value.h models/filemodel.h ) if(UNITY_BUILD) enable_unity_build(kbibtexdata kbibtexdata_LIB_SRCS) endif(UNITY_BUILD) include_directories( ${CMAKE_SOURCE_DIR}/src/config ${CMAKE_BINARY_DIR}/src/config - ${CMAKE_SOURCE_DIR}/src/global ) add_library( kbibtexdata SHARED ${kbibtexdata_LIB_SRCS} ) target_link_libraries( kbibtexdata Qt5::Core Qt5::Widgets KF5::I18n KF5::XmlGui kbibtexconfig ) set_target_properties( kbibtexdata PROPERTIES EXPORT_NAME "kbibtexdata" VERSION ${KBIBTEX_RELEASE_VERSION} SOVERSION ${KBIBTEX_SOVERSION} ) install( TARGETS kbibtexdata ${INSTALL_TARGETS_DEFAULT_ARGS} ) generate_export_header( kbibtexdata ) diff --git a/src/global/CMakeLists.txt b/src/global/CMakeLists.txt new file mode 100644 index 00000000..6f3325c8 --- /dev/null +++ b/src/global/CMakeLists.txt @@ -0,0 +1,81 @@ +set( + kbibtexglobal_LIB_SRCS + kbibtex.cpp + logging_global.cpp +) + +if(UNITY_BUILD) + enable_unity_build(kbibtexglobal kbibtexglobal_LIB_SRCS) +endif(UNITY_BUILD) + +add_library(kbibtexglobal + SHARED + ${kbibtexglobal_LIB_SRCS} +) +generate_export_header(kbibtexglobal) +add_library(KBibTeX::Global ALIAS kbibtexglobal) + +set_target_properties( + kbibtexglobal + PROPERTIES + EXPORT_NAME "kbibtexglobal" + VERSION ${KBIBTEX_RELEASE_VERSION} + SOVERSION ${KBIBTEX_SOVERSION} +) + +target_include_directories(kbibtexglobal + INTERFACE + $ + $ +) + +target_link_libraries(kbibtexglobal + PUBLIC + Qt5::Core + Qt5::Gui + PRIVATE + KF5::ConfigCore + KF5::ConfigGui + KF5::I18n +) + +install( + TARGETS kbibtexglobal + EXPORT kbibtexglobal-targets + ${KDE_INSTALL_TARGETS_DEFAULT_ARGS} +) + +set_target_properties(kbibtexglobal PROPERTIES + EXPORT_NAME "Global" +) + +ecm_generate_headers(kbibtexglobal_HEADERS + HEADER_NAMES + KBibTeX + REQUIRED_HEADERS kbibtexglobal_HEADERS +) + +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/kbibtexglobal_export.h + ${kbibtexglobal_HEADERS} + DESTINATION ${KDE_INSTALL_INCLUDEDIR}/KBibTeX/global + COMPONENT Devel +) + +include(CMakePackageConfigHelpers) +write_basic_package_version_file( + ${CMAKE_CURRENT_BINARY_DIR}/KBibTeXGlobal-configVersion.cmake + VERSION ${PROJECT_VERSION} + COMPATIBILITY ExactVersion +) + +configure_package_config_file(${CMAKE_CURRENT_LIST_DIR}/cmake/KBibTeXGlobal-config.cmake.in + ${CMAKE_CURRENT_BINARY_DIR}/KBibTeXGlobal-config.cmake + INSTALL_DESTINATION ${KDE_INSTALL_LIBDIR}/cmake/KBibTeX +) + +install(FILES + ${CMAKE_CURRENT_BINARY_DIR}/KBibTeXGlobal-config.cmake + ${CMAKE_CURRENT_BINARY_DIR}/KBibTeXGlobal-configVersion.cmake + DESTINATION ${KDE_INSTALL_LIBDIR}/cmake/KBibTeX +) diff --git a/src/global/cmake/KBibTeXGlobal-config.cmake.in b/src/global/cmake/KBibTeXGlobal-config.cmake.in new file mode 100644 index 00000000..d8eee148 --- /dev/null +++ b/src/global/cmake/KBibTeXGlobal-config.cmake.in @@ -0,0 +1,24 @@ +@PACKAGE_INIT@ + +find_package( + Qt5 @QT_MIN_VERSION@ + CONFIG + REQUIRED + Core + Gui +) + +find_package( + KF5 @KF5_MIN_VERSION@ + CONFIG + REQUIRED + ConfigCore + ConfigGui + I18n +) + +if(NOT TARGET KBibTeX::Global) + include("${KBibTeXGlobal_CMAKE_DIR}/KBibTeXGlobal-targets.cmake") +endif() + +set(KBibTeXGlobal_LIBRARIES KBibTeX::Global) diff --git a/src/global/kbibtex.h b/src/global/kbibtex.h index 3587a242..d1f56a95 100644 --- a/src/global/kbibtex.h +++ b/src/global/kbibtex.h @@ -1,104 +1,109 @@ /*************************************************************************** * Copyright (C) 2004-2019 by Thomas Fischer * * * * 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 2 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 . * ***************************************************************************/ #ifndef KBIBTEX_GLOBAL_KBIBTEX_H #define KBIBTEX_GLOBAL_KBIBTEX_H #include #include +#ifdef HAVE_KF5 +#include "kbibtexglobal_export.h" +#endif // HAVE_KF5 + #define squeeze_text(text, n) ((text).length()<=(n)?(text):(text).left((n)/2-1)+QStringLiteral("...")+(text).right((n)/2-2)) /** @author Thomas Fischer */ -class KBibTeX { +class KBIBTEXGLOBAL_EXPORT KBibTeX { public: static const QString extensionTeX; static const QString extensionAux; static const QString extensionBBL; static const QString extensionBLG; static const QString extensionBibTeX; static const QString extensionPDF; static const QString extensionPostScript; static const QString extensionRTF; enum Casing { cLowerCase = 0, cInitialCapital = 1, cUpperCamelCase = 2, cLowerCamelCase = 3, cUpperCase = 4 }; enum FieldInputType { SingleLine = 1, MultiLine = 2, List = 3, URL = 4, Month = 5, Color = 6, PersonList = 7, UrlList = 8, KeywordList = 9, CrossRef = 10, StarRating = 11, Edition = 12 }; enum TypeFlag { tfPlainText = 0x1, tfReference = 0x2, tfPerson = 0x4, tfKeyword = 0x8, tfVerbatim = 0x10, tfSource = 0x100 }; Q_DECLARE_FLAGS(TypeFlags, TypeFlag) - static const QString Months[], MonthsTriple[]; + static const QString Months[]; + static const QString MonthsTriple[]; static const QRegularExpression fileListSeparatorRegExp; static const QRegularExpression fileRegExp; static const QRegularExpression urlRegExp; static const QRegularExpression doiRegExp; static const QRegularExpression arXivRegExpWithPrefix; static const QRegularExpression arXivRegExpWithoutPrefix; static const QRegularExpression mendeleyFileRegExp; static const QRegularExpression domainNameRegExp; static const QRegularExpression htmlRegExp; static const QString doiUrlPrefix; ///< use FileInfo::doiUrlPrefix() instead static bool isLocalOrRelative(const QUrl &url); /** * Poor man's variant of a text-squeezing function. * Effect is similar as observed in KSqueezedTextLabel: * If the text is longer as n characters, the middle part * will be cut away and replaced by "..." to get a * string of max n characters. */ static QString squeezeText(const QString &text, int n); static QString leftSqueezeText(const QString &text, int n); static int validateCurlyBracketContext(const QString &text); }; Q_DECLARE_OPERATORS_FOR_FLAGS(KBibTeX::TypeFlags) #endif // KBIBTEX_GLOBAL_KBIBTEX_H diff --git a/src/global/logging_global.cpp b/src/global/logging_global.cpp new file mode 100644 index 00000000..be3c3815 --- /dev/null +++ b/src/global/logging_global.cpp @@ -0,0 +1,20 @@ +/*************************************************************************** + * Copyright (C) 2004-2019 by Thomas Fischer * + * * + * 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 2 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 . * + ***************************************************************************/ + +#include "logging_global.h" + +Q_LOGGING_CATEGORY(LOG_KBIBTEX_GLOBAL, "kbibtex.global") diff --git a/src/global/logging_global.h b/src/global/logging_global.h new file mode 100644 index 00000000..0d0c72a6 --- /dev/null +++ b/src/global/logging_global.h @@ -0,0 +1,25 @@ +/*************************************************************************** + * Copyright (C) 2004-2019 by Thomas Fischer * + * * + * 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 2 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 . * + ***************************************************************************/ + +#ifndef KBIBTEX_GLOBAL_LOGGING_GLOBAL_H +#define KBIBTEX_GLOBAL_LOGGING_GLOBAL_H + +#include + +Q_DECLARE_LOGGING_CATEGORY(LOG_KBIBTEX_GLOBAL) + +#endif // KBIBTEX_GLOBAL_LOGGING_GLOBAL_H diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index b2246ae1..13fe6b54 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -1,139 +1,137 @@ # KBibTeX GUI library set( kbibtexgui_LIB_SRCS field/fieldinput.cpp field/fieldlineedit.cpp field/fieldlistedit.cpp field/colorlabelwidget.cpp file/fileview.cpp file/filedelegate.cpp file/partwidget.cpp file/findduplicatesui.cpp file/clipboard.cpp file/basicfileview.cpp file/sortfilterfilemodel.cpp element/elementeditor.cpp element/elementwidgets.cpp element/findpdfui.cpp element/associatedfilesui.cpp widgets/menulineedit.cpp widgets/filesettingswidget.cpp widgets/filterbar.cpp widgets/radiobuttontreeview.cpp widgets/hidingtabwidget.cpp widgets/starrating.cpp widgets/rangewidget.cpp config/entrylayout.cpp preferences/kbibtexpreferencesdialog.cpp preferences/settingsgeneralwidget.cpp preferences/settingsglobalkeywordswidget.cpp preferences/settingscolorlabelwidget.cpp preferences/settingsuserinterfacewidget.cpp preferences/settingsfileexporterpdfpswidget.cpp preferences/settingsfileexporterwidget.cpp preferences/settingsabstractwidget.cpp preferences/settingsidsuggestionswidget.cpp preferences/settingsidsuggestionseditor.cpp guihelper.cpp italictextitemmodel.cpp valuelistmodel.cpp delayedexecutiontimer.cpp - ${CMAKE_SOURCE_DIR}/src/global/kbibtex.cpp ${CMAKE_SOURCE_DIR}/src/config/preferences.cpp logging_gui.cpp ) set( kbibtexgui_HDRS field/fieldinput.h field/colorlabelwidget.h field/fieldlineedit.h widgets/filterbar.h preferences/settingsuserinterfacewidget.h preferences/kbibtexpreferencesdialog.h preferences/settingsglobalkeywordswidget.h preferences/settingsfileexporterwidget.h preferences/settingsgeneralwidget.h preferences/settingsabstractwidget.h preferences/settingscolorlabelwidget.h preferences/settingsfileexporterpdfpswidget.h preferences/settingsidsuggestionswidget.h preferences/settingsidsuggestionseditor.h guihelper.h valuelistmodel.h italictextitemmodel.h delayedexecutiontimer.h file/findduplicatesui.h file/basicfileview.h file/clipboard.h file/fileview.h file/filedelegate.h file/sortfilterfilemodel.h file/partwidget.h element/findpdfui.h element/elementeditor.h element/associatedfilesui.h ) if(UNITY_BUILD) enable_unity_build(kbibtexgui kbibtexgui_LIB_SRCS) endif(UNITY_BUILD) include_directories( ${CMAKE_SOURCE_DIR}/src/config ${CMAKE_BINARY_DIR}/src/config ${CMAKE_SOURCE_DIR}/src/data ${CMAKE_BINARY_DIR}/src/data ${CMAKE_SOURCE_DIR}/src/io ${CMAKE_BINARY_DIR}/src/io ${CMAKE_SOURCE_DIR}/src/io/config ${CMAKE_SOURCE_DIR}/src/networking ${CMAKE_BINARY_DIR}/src/networking ${CMAKE_SOURCE_DIR}/src/processing ${CMAKE_BINARY_DIR}/src/processing ${CMAKE_SOURCE_DIR}/src/gui ${CMAKE_BINARY_DIR}/src/gui ${CMAKE_SOURCE_DIR}/src/gui/file ${CMAKE_SOURCE_DIR}/src/gui/dialogs ${CMAKE_SOURCE_DIR}/src/gui/element ${CMAKE_SOURCE_DIR}/src/gui/field ${CMAKE_SOURCE_DIR}/src/gui/widgets ${CMAKE_SOURCE_DIR}/src/gui/config - ${CMAKE_SOURCE_DIR}/src/global ) add_library( kbibtexgui SHARED ${kbibtexgui_LIB_SRCS} ) target_link_libraries( kbibtexgui Qt5::Core KF5::IconThemes KF5::ItemViews KF5::Completion KF5::TextEditor kbibtexconfig kbibtexdata kbibtexio kbibtexnetworking kbibtexproc ) set_target_properties( kbibtexgui PROPERTIES EXPORT_NAME "kbibtexgui" VERSION ${KBIBTEX_RELEASE_VERSION} SOVERSION ${KBIBTEX_SOVERSION} ) install( TARGETS kbibtexgui ${INSTALL_TARGETS_DEFAULT_ARGS} ) generate_export_header( kbibtexgui ) diff --git a/src/io/CMakeLists.txt b/src/io/CMakeLists.txt index fdc9f1c0..a752b44c 100644 --- a/src/io/CMakeLists.txt +++ b/src/io/CMakeLists.txt @@ -1,107 +1,105 @@ # KBibTeXIO library set( kbibtexio_LIB_SRCS encoder.cpp encoderlatex.cpp encoderxml.cpp fileexporterbibtex2html.cpp fileexporterbibtex.cpp fileexporterbibutils.cpp fileexporterbibtexoutput.cpp fileexporter.cpp fileexporterpdf.cpp fileexporterps.cpp fileexporterris.cpp fileexporterrtf.cpp fileexportertoolchain.cpp fileexporterxml.cpp fileexporterxslt.cpp fileimporterbibtex.cpp fileimporterbibutils.cpp fileimporter.cpp fileimporterpdf.cpp fileimporterris.cpp fileinfo.cpp textencoder.cpp bibutils.cpp xsltransform.cpp - ${CMAKE_SOURCE_DIR}/src/global/kbibtex.cpp ${CMAKE_SOURCE_DIR}/src/config/preferences.cpp logging_io.cpp ) set( kbibtexio_HDRS encoder.h encoderlatex.h encoderxml.h fileexporterbibtex2html.h fileexporterbibtex.h fileexporterbibutils.h fileexporterbibtexoutput.h fileexporter.h fileexporterpdf.h fileexporterps.h fileexporterris.h fileexporterrtf.h fileexportertoolchain.h fileexporterxml.h fileexporterxslt.h fileimporterbibtex.h fileimporterbibutils.h fileimporter.h fileimporterpdf.h fileimporterris.h fileinfo.h textencoder.h bibutils.h xsltransform.h ) if(UNITY_BUILD) enable_unity_build(kbibtexio kbibtexio_LIB_SRCS) endif(UNITY_BUILD) include_directories( ${CMAKE_SOURCE_DIR}/src/config ${CMAKE_BINARY_DIR}/src/config ${CMAKE_SOURCE_DIR}/src/data ${CMAKE_BINARY_DIR}/src/data - ${CMAKE_SOURCE_DIR}/src/global ) add_library( kbibtexio SHARED ${kbibtexio_LIB_SRCS} ) target_link_libraries( kbibtexio Qt5::Core Qt5::Widgets Qt5::XmlPatterns Qt5::Concurrent KF5::I18n KF5::XmlGui Poppler::Qt5 ${ICU_LIBRARIES} kbibtexconfig kbibtexdata ) set_target_properties( kbibtexio PROPERTIES EXPORT_NAME "kbibtexio" VERSION ${KBIBTEX_RELEASE_VERSION} SOVERSION ${KBIBTEX_SOVERSION} ) install( TARGETS kbibtexio ${INSTALL_TARGETS_DEFAULT_ARGS} ) generate_export_header( kbibtexio ) diff --git a/src/networking/CMakeLists.txt b/src/networking/CMakeLists.txt index c3ac57bf..1ff87135 100644 --- a/src/networking/CMakeLists.txt +++ b/src/networking/CMakeLists.txt @@ -1,138 +1,136 @@ # Network library set( kbibtexnetworking_LIB_SRCS onlinesearch/onlinesearchabstract.cpp onlinesearch/onlinesearchbibsonomy.cpp onlinesearch/onlinesearcharxiv.cpp onlinesearch/onlinesearchsciencedirect.cpp onlinesearch/onlinesearchgooglescholar.cpp onlinesearch/onlinesearchieeexplore.cpp onlinesearch/onlinesearchpubmed.cpp onlinesearch/onlinesearchacmportal.cpp onlinesearch/onlinesearchspringerlink.cpp onlinesearch/onlinesearchjstor.cpp onlinesearch/onlinesearchmathscinet.cpp onlinesearch/onlinesearchmrlookup.cpp onlinesearch/onlinesearchinspirehep.cpp onlinesearch/onlinesearchcernds.cpp onlinesearch/onlinesearchingentaconnect.cpp onlinesearch/onlinesearchsimplebibtexdownload.cpp onlinesearch/onlinesearchgeneral.cpp onlinesearch/onlinesearchsoanasaads.cpp # onlinesearch/onlinesearchisbndb.cpp # disabled as provider switched to a paid model on 2017-12-26 onlinesearch/onlinesearchideasrepec.cpp onlinesearch/onlinesearchdoi.cpp onlinesearch/onlinesearchbiorxiv.cpp onlinesearch/onlinesearchsemanticscholar.cpp zotero/api.cpp zotero/collectionmodel.cpp zotero/collection.cpp zotero/items.cpp zotero/groups.cpp zotero/oauthwizard.cpp zotero/tags.cpp zotero/tagmodel.cpp associatedfiles.cpp findpdf.cpp internalnetworkaccessmanager.cpp - ${CMAKE_SOURCE_DIR}/src/global/kbibtex.cpp ${CMAKE_SOURCE_DIR}/src/config/preferences.cpp logging_networking.cpp ) set( kbibtexnetworking_HDRS onlinesearch/onlinesearchgeneral.h onlinesearch/onlinesearchsciencedirect.h onlinesearch/onlinesearchabstract.h onlinesearch/onlinesearchacmportal.h onlinesearch/onlinesearchbibsonomy.h onlinesearch/onlinesearchgooglescholar.h onlinesearch/onlinesearchspringerlink.h onlinesearch/onlinesearchjstor.h onlinesearch/onlinesearchieeexplore.h onlinesearch/onlinesearcharxiv.h onlinesearch/onlinesearchpubmed.h onlinesearch/onlinesearchingentaconnect.h onlinesearch/onlinesearchsimplebibtexdownload.h onlinesearch/onlinesearchsoanasaads.h onlinesearch/onlinesearchmathscinet.h onlinesearch/onlinesearchmrlookup.h onlinesearch/onlinesearchinspirehep.h onlinesearch/onlinesearchcernds.h onlinesearch/onlinesearchisbndb.h onlinesearch/onlinesearchideasrepec.h onlinesearch/onlinesearchdoi.h onlinesearch/onlinesearchbiorxiv.h onlinesearch/onlinesearchsemanticscholar.h zotero/api.h zotero/collectionmodel.h zotero/collection.h zotero/items.h zotero/groups.h zotero/oauthwizard.h zotero/tags.h zotero/tagmodel.h associatedfiles.h findpdf.h internalnetworkaccessmanager.h ) if(UNITY_BUILD) enable_unity_build(kbibtexnetworking kbibtexnetworking_LIB_SRCS) endif(UNITY_BUILD) include_directories( ${CMAKE_BINARY_DIR}/src/config ${CMAKE_SOURCE_DIR}/src/config ${CMAKE_BINARY_DIR}/src/data ${CMAKE_SOURCE_DIR}/src/data ${CMAKE_BINARY_DIR}/src/io ${CMAKE_SOURCE_DIR}/src/io ${CMAKE_SOURCE_DIR}/src/networking/onlinesearch ${CMAKE_SOURCE_DIR}/src/networking - ${CMAKE_SOURCE_DIR}/src/global ) add_library( kbibtexnetworking SHARED ${kbibtexnetworking_LIB_SRCS} ) target_link_libraries( kbibtexnetworking Qt5::Core Qt5::Widgets Qt5::Network Qt5::NetworkAuth KF5::I18n KF5::XmlGui KF5::Completion KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM KF5::Wallet kbibtexconfig kbibtexdata kbibtexio Poppler::Qt5 ) set_target_properties( kbibtexnetworking PROPERTIES EXPORT_NAME "kbibtexnetworking" VERSION ${KBIBTEX_RELEASE_VERSION} SOVERSION ${KBIBTEX_SOVERSION} ) install( TARGETS kbibtexnetworking ${INSTALL_TARGETS_DEFAULT_ARGS} ) generate_export_header( kbibtexnetworking ) diff --git a/src/parts/CMakeLists.txt b/src/parts/CMakeLists.txt index e498b56b..469fb7e1 100644 --- a/src/parts/CMakeLists.txt +++ b/src/parts/CMakeLists.txt @@ -1,88 +1,87 @@ # KBibTeX KPart set( kbibtexpart_SRCS part.cpp partfactory.cpp browserextension.cpp ${CMAKE_SOURCE_DIR}/src/config/preferences.cpp logging_parts.cpp ) if(UNITY_BUILD) enable_unity_build(kbibtexpart kbibtexpart_SRCS) endif(UNITY_BUILD) include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/config ${CMAKE_SOURCE_DIR}/src/data ${CMAKE_BINARY_DIR}/src/io ${CMAKE_SOURCE_DIR}/src/io ${CMAKE_SOURCE_DIR}/src/gui ${CMAKE_SOURCE_DIR}/src/gui/config ${CMAKE_SOURCE_DIR}/src/gui/element ${CMAKE_SOURCE_DIR}/src/gui/preferences ${CMAKE_SOURCE_DIR}/src/gui/widgets ${CMAKE_SOURCE_DIR}/src/gui/file ${CMAKE_SOURCE_DIR}/src/processing ${CMAKE_SOURCE_DIR}/src/networking - ${CMAKE_SOURCE_DIR}/src/global ) # Creates kbibtex-git-info.h containing information about the source code's Git revision # (if source directory is a Git clone) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_SOURCE_DIR} -DBINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/src/getgit.cmake ) set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h PROPERTIES GENERATED 1 HEADER_FILE_ONLY 1 SKIP_AUTOMOC ON SKIP_AUTOUIC ON SKIP_AUTOGEN ON ) add_library( kbibtexpart MODULE ${kbibtexpart_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h ) target_link_libraries( kbibtexpart KF5::Parts kbibtexconfig kbibtexdata kbibtexio kbibtexgui kbibtexproc ) install( TARGETS kbibtexpart DESTINATION ${KDE_INSTALL_PLUGINDIR} ) kcoreaddons_desktop_to_json(kbibtexpart kbibtexpart.desktop SERVICE_TYPES kpart.desktop) install( FILES kbibtexpart.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} ) install( FILES kbibtexpartui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kbibtexpart ) diff --git a/src/processing/CMakeLists.txt b/src/processing/CMakeLists.txt index 6637f725..d87e90b7 100644 --- a/src/processing/CMakeLists.txt +++ b/src/processing/CMakeLists.txt @@ -1,69 +1,68 @@ # KBibTeX Processing library set( kbibtexproc_LIB_SRCS findduplicates.cpp idsuggestions.cpp lyx.cpp checkbibtex.cpp bibliographyservice.cpp journalabbreviations.cpp ${CMAKE_SOURCE_DIR}/src/config/preferences.cpp logging_processing.cpp ) set( kbibtexproc_HDRS findduplicates.h idsuggestions.h lyx.h checkbibtex.h bibliographyservice.h journalabbreviations.h ) if(UNITY_BUILD) enable_unity_build(kbibtexproc kbibtexproc_LIB_SRCS) endif(UNITY_BUILD) include_directories( ${CMAKE_BINARY_DIR}/src/config ${CMAKE_SOURCE_DIR}/src/config ${CMAKE_BINARY_DIR}/src/data ${CMAKE_SOURCE_DIR}/src/data ${CMAKE_BINARY_DIR}/src/io ${CMAKE_SOURCE_DIR}/src/io - ${CMAKE_SOURCE_DIR}/src/global ${CMAKE_BINARY_DIR}/src/gui ${CMAKE_SOURCE_DIR}/src/gui ) add_library( kbibtexproc SHARED ${kbibtexproc_LIB_SRCS} ) target_link_libraries( kbibtexproc Qt5::Core KF5::Parts kbibtexconfig kbibtexdata kbibtexio ) set_target_properties( kbibtexproc PROPERTIES EXPORT_NAME "kbibtexproc" VERSION ${KBIBTEX_RELEASE_VERSION} SOVERSION ${KBIBTEX_SOVERSION} ) install( TARGETS kbibtexproc ${INSTALL_TARGETS_DEFAULT_ARGS} ) generate_export_header( kbibtexproc ) diff --git a/src/program/CMakeLists.txt b/src/program/CMakeLists.txt index 0eaa8053..5792abf1 100644 --- a/src/program/CMakeLists.txt +++ b/src/program/CMakeLists.txt @@ -1,157 +1,155 @@ # KBibTeX main program project( kbibtexprogram ) set( kbibtex_SRCS program.cpp mainwindow.cpp documentlist.cpp mdiwidget.cpp docklets/statistics.cpp docklets/referencepreview.cpp docklets/documentpreview.cpp docklets/valuelist.cpp docklets/searchform.cpp docklets/searchresults.cpp docklets/elementform.cpp docklets/filesettings.cpp docklets/zoterobrowser.cpp openfileinfo.cpp - ${CMAKE_SOURCE_DIR}/src/global/kbibtex.cpp logging_program.cpp ) if(UNITY_BUILD AND NOT WIN32) # FIXME: Unity build of programs breaks on Windows enable_unity_build(kbibtex kbibtex_SRCS) endif(UNITY_BUILD AND NOT WIN32) include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/config ${CMAKE_BINARY_DIR}/src/config ${CMAKE_SOURCE_DIR}/src/data ${CMAKE_BINARY_DIR}/src/data ${CMAKE_SOURCE_DIR}/src/processing ${CMAKE_BINARY_DIR}/src/processing ${CMAKE_SOURCE_DIR}/src/io ${CMAKE_BINARY_DIR}/src/io ${CMAKE_SOURCE_DIR}/src/io/config ${CMAKE_SOURCE_DIR}/src/networking ${CMAKE_BINARY_DIR}/src/networking ${CMAKE_SOURCE_DIR}/src/networking/onlinesearch ${CMAKE_SOURCE_DIR}/src/gui ${CMAKE_BINARY_DIR}/src/gui ${CMAKE_SOURCE_DIR}/src/gui/widgets ${CMAKE_SOURCE_DIR}/src/gui/file ${CMAKE_SOURCE_DIR}/src/gui/element ${CMAKE_SOURCE_DIR}/src/program/docklets - ${CMAKE_SOURCE_DIR}/src/global ) ecm_add_app_icon( kbibtex_SRCS ICONS ${CMAKE_SOURCE_DIR}/icons/128-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/16-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/22-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/32-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/48-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/64-apps-kbibtex.png ) # Creates kbibtex-git-info.h containing information about the source code's Git revision # (if source directory is a Git clone) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_SOURCE_DIR} -DBINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/src/getgit.cmake ) set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h PROPERTIES GENERATED 1 HEADER_FILE_ONLY 1 SKIP_AUTOMOC ON SKIP_AUTOUIC ON SKIP_AUTOGEN ON ) add_executable( kbibtex ${kbibtex_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h ) target_link_libraries( kbibtex Qt5::Core Qt5::Widgets KF5::CoreAddons KF5::I18n KF5::ConfigCore KF5::Service KF5::Parts KF5::IconThemes KF5::KIOCore KF5::KIOFileWidgets KF5::KIOWidgets KF5::KIONTLM KF5::Crash kbibtexio kbibtexgui kbibtexnetworking ) if(Qt5WebEngineWidgets_FOUND) target_link_libraries( kbibtex Qt5::WebEngineWidgets ) else(Qt5WebEngineWidgets_FOUND) if(Qt5WebKitWidgets_FOUND) target_link_libraries( kbibtex Qt5::WebKitWidgets ) endif(Qt5WebKitWidgets_FOUND) endif(Qt5WebEngineWidgets_FOUND) install( TARGETS kbibtex ${INSTALL_TARGETS_DEFAULT_ARGS} ) install( PROGRAMS org.kde.kbibtex.desktop DESTINATION ${KDE_INSTALL_APPDIR} ) install( FILES kbibtexui.rc DESTINATION ${KDE_INSTALL_KXMLGUI5DIR}/kbibtex ) install( FILES org.kde.kbibtex.appdata.xml DESTINATION ${KDE_INSTALL_METAINFODIR} ) ecm_install_icons( ICONS ${CMAKE_SOURCE_DIR}/icons/128-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/16-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/22-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/32-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/48-apps-kbibtex.png ${CMAKE_SOURCE_DIR}/icons/64-apps-kbibtex.png DESTINATION ${KDE_INSTALL_ICONDIR} ) diff --git a/src/test/CMakeLists.txt b/src/test/CMakeLists.txt index 857e8c16..04eae882 100644 --- a/src/test/CMakeLists.txt +++ b/src/test/CMakeLists.txt @@ -1,187 +1,185 @@ # KBibTeX test program project( test ) include( AddFileDependencies ) include( ECMMarkAsTest ) configure_file(test-config.h.in test-config.h @ONLY) include_directories( ${CMAKE_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_SOURCE_DIR}/src/config ${CMAKE_SOURCE_DIR}/src/data ${CMAKE_SOURCE_DIR}/src/io - ${CMAKE_SOURCE_DIR}/src/global ${CMAKE_SOURCE_DIR}/src/gui ${CMAKE_SOURCE_DIR}/src/gui/config ${CMAKE_SOURCE_DIR}/src/gui/bibtex ${CMAKE_SOURCE_DIR}/src/gui/element ${CMAKE_SOURCE_DIR}/src/gui/widgets ${CMAKE_SOURCE_DIR}/src/networking ${CMAKE_SOURCE_DIR}/src/networking/onlinesearch ${CMAKE_SOURCE_DIR}/src/processing ) set( kbibtextest_SRCS main.cpp kbibtextest.cpp logging_test.cpp ) set( kbibtexfilestest_SRCS kbibtexfilestest.cpp kbibtexfilestest-rawdata.h ) set( kbibtexnetworkingtest_SRCS kbibtexnetworkingtest.cpp ) set( kbibtexiotest_SRCS kbibtexiotest.cpp - ${CMAKE_SOURCE_DIR}/src/global/kbibtex.cpp ${CMAKE_SOURCE_DIR}/src/config/preferences.cpp ) set( kbibtexdatatest_SRCS kbibtexdatatest.cpp ) if(UNITY_BUILD AND NOT WIN32) # FIXME: Unity build of programs breaks on Windows enable_unity_build(kbibtextest kbibtextest_SRCS) enable_unity_build(kbibtexfilestest kbibtexfilestest_SRCS) enable_unity_build(kbibtexnetworkingtest kbibtexnetworkingtest_SRCS) enable_unity_build(kbibtexiotest kbibtexiotest_SRCS) enable_unity_build(kbibtexdatatest kbibtexdatatest_SRCS) endif(UNITY_BUILD AND NOT WIN32) # Creates kbibtex-git-info.h containing information about the source code's Git revision # (if source directory is a Git clone) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_SOURCE_DIR} -DBINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/src/getgit.cmake ) set_source_files_properties( ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h PROPERTIES GENERATED 1 HEADER_FILE_ONLY 1 SKIP_AUTOMOC ON SKIP_AUTOUIC ON SKIP_AUTOGEN ON ) add_executable( kbibtextest ${kbibtextest_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h ) add_executable( kbibtexfilestest ${kbibtexfilestest_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h ) add_executable( kbibtexnetworkingtest ${kbibtexnetworkingtest_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h ) add_executable( kbibtexiotest ${kbibtexiotest_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h ) add_executable( kbibtexdatatest ${kbibtexdatatest_SRCS} ${CMAKE_CURRENT_BINARY_DIR}/kbibtex-git-info.h ) target_link_libraries( kbibtextest Qt5::Core KF5::KIOCore kbibtexconfig kbibtexdata kbibtexio kbibtexproc kbibtexgui kbibtexnetworking ) target_link_libraries( kbibtexfilestest Qt5::Test kbibtexdata kbibtexio ) target_link_libraries( kbibtexnetworkingtest Qt5::Test kbibtexnetworking ) target_link_libraries( kbibtexiotest Qt5::Test kbibtexio ) target_link_libraries( kbibtexdatatest Qt5::Test kbibtexdata ) ecm_mark_as_test( kbibtexfilestest kbibtexnetworkingtest kbibtexiotest kbibtexdatatest ) add_test( NAME kbibtexfilestest COMMAND kbibtexfilestest ) add_test( NAME kbibtexnetworkingtest COMMAND kbibtexnetworkingtest ) add_test( NAME kbibtexiotest COMMAND kbibtexiotest ) add_test( NAME kbibtexdatatest COMMAND kbibtexdatatest )