diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -196,44 +196,32 @@ include(KDECompilerSettings) include(FeatureSummary) -find_package(KF5 5.7.0 REQUIRED COMPONENTS - Archive - Codecs +set(MINIMUM_KF5_VERSION 5.7.0) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS + Archive + Config Completion - Config - ConfigWidgets CoreAddons - Emoticons - GlobalAccel - GuiAddons - I18n - IconThemes - ItemModels - ItemViews + IconThemes + I18n KDELibs4Support - KIO - Kross - Parts - Sonnet - TextEditor - TextWidgets - ThreadWeaver - Wallet - WidgetsAddons - WindowSystem - XmlGui + KIO + WidgetsAddons + XmlGui OPTIONAL_COMPONENTS + Kross NotifyConfig Activities KHtml ) + if(KF5_Activities_FOUND) set(HAVE_KACTIVITIES TRUE) endif() - -find_package(Qt5 5.3.0 REQUIRED COMPONENTS Core Gui Widgets Xml Network PrintSupport - Script Svg Test Concurrent) -find_package(Qt5 5.3.0 COMPONENTS UiTools Sql WebKit WebKitWidgets DBus Declarative Qml Quick X11Extras) +set(REQUIRED_QT_VERSION 5.3.0) +find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED COMPONENTS Core Gui Widgets Xml Network PrintSupport + Script Svg Test Concurrent) +find_package(Qt5 ${REQUIRED_QT_VERSION} COMPONENTS UiTools WebKit WebKitWidgets DBus Declarative Qml Quick) set(QT_QTDBUS_FOUND ${Qt5DBus_FOUND}) set(QT_QTWEBKIT_FOUND ${Qt5WebKit_FOUND}) @@ -243,13 +231,11 @@ set(QT_QTTEST_LIBRARY Qt5::Test) if (USEOPENGL) - find_package(Qt5 5.3.0 REQUIRED OpenGL) + find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED OpenGL) set(QT_QTOPENGL_FOUND ${Qt5OpenGL_FOUND}) endif () - - include (MacroLibrary) include (MacroAdditionalCleanFiles) include (MacroAddFileDependencies) @@ -269,13 +255,17 @@ macro_ensure_out_of_source_build("Compiling Calligra inside the source directory is not possible. Please refer to the build instruction http://community.kde.org/Calligra/Building/Building_Calligra") -find_package(X11) -if(X11_FOUND) - find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE COMPONENTS - X11Extras - ) - set(HAVE_X11 TRUE) - add_definitions(-DHAVE_X11) +if(NOT WIN32 AND NOT APPLE) + find_package(X11) + if(X11_FOUND) + find_package(Qt5 ${REQUIRED_QT_VERSION} REQUIRED NO_MODULE + COMPONENTS X11Extras + ) + set(HAVE_X11 TRUE) + add_definitions(-DHAVE_X11) + else() + set(HAVE_X11 FALSE) + endif() else() set(HAVE_X11 FALSE) endif() @@ -1135,7 +1125,9 @@ add_subdirectory(flow) endif () -add_subdirectory(stage) +if(SHOULD_BUILD_APP_STAGE) + add_subdirectory(stage) +endif() if(SHOULD_BUILD_APP_KEXI) add_subdirectory(kexi) @@ -1145,7 +1137,9 @@ add_subdirectory(plan) endif() -add_subdirectory(sheets) +if(SHOULD_BUILD_APP_SHEETS) + add_subdirectory(sheets) +endif() if(SHOULD_BUILD_APP_KRITA) add_subdirectory(krita) diff --git a/kexi/core/CMakeLists.txt b/kexi/core/CMakeLists.txt --- a/kexi/core/CMakeLists.txt +++ b/kexi/core/CMakeLists.txt @@ -1,5 +1,7 @@ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=44020) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS ItemViews ConfigWidgets) + set(kexicore_LIB_SRCS kexi_global.cpp kexi.cpp @@ -54,6 +56,7 @@ KF5::KIOWidgets KF5::CoreAddons KF5::XmlGui + KF5::IconThemes kexiutils kowidgetutils # KoGroupButton diff --git a/kexi/formeditor/CMakeLists.txt b/kexi/formeditor/CMakeLists.txt --- a/kexi/formeditor/CMakeLists.txt +++ b/kexi/formeditor/CMakeLists.txt @@ -50,7 +50,7 @@ kexicore kexiextendedwidgets kundo2 - kowidgets # KoFileDialog + kowidgetutils # KoFileDialog KDb KProperty diff --git a/kexi/kexiutils/CMakeLists.txt b/kexi/kexiutils/CMakeLists.txt --- a/kexi/kexiutils/CMakeLists.txt +++ b/kexi/kexiutils/CMakeLists.txt @@ -1,5 +1,7 @@ add_definitions(-DKDE_DEFAULT_DEBUG_AREA=44024) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS ItemViews ConfigWidgets) + include_directories(completer) set(kexiutils_LIB_SRCS @@ -52,7 +54,6 @@ PUBLIC KF5::KIOWidgets #for KRun... KF5::IconThemes - KF5::WidgetsAddons KF5::ConfigWidgets # KStandardAction KColorScheme KF5::I18n KF5::ItemViews # KCategorizedView KCategoryDrawer diff --git a/kexi/plugins/importexport/csv/CMakeLists.txt b/kexi/plugins/importexport/csv/CMakeLists.txt --- a/kexi/plugins/importexport/csv/CMakeLists.txt +++ b/kexi/plugins/importexport/csv/CMakeLists.txt @@ -1,5 +1,7 @@ include_directories(${CMAKE_SOURCE_DIR}/kexi/core ${CMAKE_SOURCE_DIR}/kexi/widget) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS Codecs) + # the main plugin set(kexi_csvimportexportplugin_SRCS KexiCsvImportExportPlugin.cpp diff --git a/kexi/plugins/reports/CMakeLists.txt b/kexi/plugins/reports/CMakeLists.txt --- a/kexi/plugins/reports/CMakeLists.txt +++ b/kexi/plugins/reports/CMakeLists.txt @@ -38,11 +38,9 @@ KReport KProperty - KF5::KrossCore KF5::KDELibs4Support Qt5::Gui - Qt5::Script ) if (KEXI_MOBILE) diff --git a/kexi/widget/CMakeLists.txt b/kexi/widget/CMakeLists.txt --- a/kexi/widget/CMakeLists.txt +++ b/kexi/widget/CMakeLists.txt @@ -2,6 +2,8 @@ add_subdirectory( dataviewcommon ) add_subdirectory( relations ) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS Codecs TextWidgets TextEditor) + if(KEXI_MOBILE) else() diff --git a/krita/ui/CMakeLists.txt b/krita/ui/CMakeLists.txt --- a/krita/ui/CMakeLists.txt +++ b/krita/ui/CMakeLists.txt @@ -27,6 +27,8 @@ find_library(FOUNDATION_LIBRARY Foundation) endif () +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS GlobalAccel) + set(kritaui_LIB_SRCS canvas/kis_canvas_widget_base.cpp canvas/kis_canvas2.cpp @@ -464,6 +466,9 @@ if(HAVE_OPENGL) target_link_libraries(kritaui ${OPENGL_LIBRARIES} Qt5::OpenGL ${OPENEXR_LIBRARIES}) + if(X11_FOUND) + target_link_libraries(kritaui Qt5::X11Extras) + endif() # Add VSync disable workaround if(NOT WIN32) diff --git a/libs/kotext/CMakeLists.txt b/libs/kotext/CMakeLists.txt --- a/libs/kotext/CMakeLists.txt +++ b/libs/kotext/CMakeLists.txt @@ -137,6 +137,8 @@ add_library(kotext SHARED ${kotext_LIB_SRCS}) generate_export_header(kotext BASE_NAME kotext) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS TextWidgets) + target_link_libraries(kotext flake KF5::TextWidgets KF5::XmlGui KF5::WindowSystem) if( SHOULD_BUILD_FEATURE_RDF ) target_link_libraries(kotext ${SOPRANO_LIBRARIES}) diff --git a/libs/kundo2/CMakeLists.txt b/libs/kundo2/CMakeLists.txt --- a/libs/kundo2/CMakeLists.txt +++ b/libs/kundo2/CMakeLists.txt @@ -12,6 +12,7 @@ add_library(kundo2 SHARED ${kundo2_LIB_SRCS}) generate_export_header(kundo2 BASE_NAME kundo2) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS ConfigWidgets) target_link_libraries(kundo2 KF5::IconThemes KF5::I18n KF5::XmlGui KF5::ConfigWidgets Qt5::Core Qt5::Widgets) set_target_properties(kundo2 PROPERTIES diff --git a/libs/odf/CMakeLists.txt b/libs/odf/CMakeLists.txt --- a/libs/odf/CMakeLists.txt +++ b/libs/odf/CMakeLists.txt @@ -1,6 +1,11 @@ add_subdirectory( tests ) add_subdirectory( writeodf ) +find_package(KF5 ${MINIMUM_KF5_VERSION} + REQUIRED COMPONENTS Sonnet + OPTIONAL_COMPONENTS Wallet +) + include_directories( ${KOODF_INCLUDES} ) ########### libkoodf ############### @@ -46,8 +51,15 @@ add_dependencies(koodf writeodf.h-target) generate_export_header(koodf BASE_NAME koodf) -target_link_libraries(koodf koversion kostore KF5::Archive KF5::Wallet KF5::KIOWidgets KF5::I18n Qt5::PrintSupport Qt5::Gui Qt5::Xml) +target_link_libraries(koodf koversion kostore KF5::Archive KF5::KIOWidgets KF5::I18n Qt5::PrintSupport Qt5::Gui Qt5::Xml) target_link_libraries(koodf LINK_INTERFACE_LIBRARIES kostore KF5::I18n Qt5::PrintSupport Qt5::Gui Qt5::Xml) +if( KF5Wallet_FOUND ) + target_link_libraries(koodf KF5::Wallet) + add_definitions( -DKF5Wallet ) +endif() +if( Qca-qt5_FOUND ) + target_link_libraries(koodf qca-qt5) +endif() set_target_properties(koodf PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION} diff --git a/libs/odf/KoEncryptionChecker.cpp b/libs/odf/KoEncryptionChecker.cpp --- a/libs/odf/KoEncryptionChecker.cpp +++ b/libs/odf/KoEncryptionChecker.cpp @@ -19,7 +19,7 @@ #include "KoEncryptionChecker.h" -#ifdef QCA2 +#if defined QCA2 && defined KF5Wallet // QCA headers have "slots" and "signals", which QT_NO_SIGNALS_SLOTS_KEYWORDS does not like #define slots Q_SLOTS diff --git a/libs/odf/tests/TestStorage.cpp b/libs/odf/tests/TestStorage.cpp --- a/libs/odf/tests/TestStorage.cpp +++ b/libs/odf/tests/TestStorage.cpp @@ -59,7 +59,7 @@ QTest::newRow("tar") << (int) KoStore::Tar << "test.tgz"; QTest::newRow("directory") << (int) KoStore::Directory << "testdir"; QTest::newRow("zip") << (int) KoStore::Zip <<"test.zip"; -#ifdef QCA2 +#if defined QCA2 && defined KF5Wallet if (KoEncryptionChecker::isEncryptionSupported()) { QTest::newRow("Encrypted") << (int) KoStore::Encrypted << "testEncrypted.zip"; } diff --git a/libs/store/CMakeLists.txt b/libs/store/CMakeLists.txt --- a/libs/store/CMakeLists.txt +++ b/libs/store/CMakeLists.txt @@ -1,3 +1,7 @@ +find_package(KF5 ${MINIMUM_KF5_VERSION} + OPTIONAL_COMPONENTS Wallet +) + include_directories({KOVERSION_INCLUDES}) add_subdirectory(tests) @@ -25,8 +29,12 @@ add_library(kostore SHARED ${kostore_LIB_SRCS}) generate_export_header(kostore BASE_NAME kostore) -target_link_libraries(kostore Qt5::Xml Qt5::Gui KF5::Archive KF5::Wallet KF5::KIOWidgets KF5::I18n KF5::KIOCore) -#target_link_libraries(kostore LINK_INTERFACE_LIBRARIES KF5::I18n Qt5::PrintSupport Qt5::Gui Qt5::Xml) +target_link_libraries(kostore Qt5::Core Qt5::Xml Qt5::Gui KF5::Archive KF5::KIOWidgets KF5::I18n KF5::KIOCore) +target_link_libraries(kostore LINK_INTERFACE_LIBRARIES KF5::I18n Qt5::PrintSupport Qt5::Gui Qt5::Xml) +if( KF5Wallet_FOUND ) + target_link_libraries(kostore KF5::Wallet) + add_definitions( -DKF5Wallet ) +endif() if( Qca-qt5_FOUND ) target_link_libraries(kostore qca-qt5) endif() diff --git a/libs/store/KoEncryptedStore.cpp b/libs/store/KoEncryptedStore.cpp --- a/libs/store/KoEncryptedStore.cpp +++ b/libs/store/KoEncryptedStore.cpp @@ -17,7 +17,7 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifdef QCA2 +#if defined QCA2 && defined KF5Wallet #include "KoEncryptedStore.h" #include "KoEncryptionChecker.h" @@ -848,4 +848,4 @@ return (entry && entry->isFile()) || (absPath == MANIFEST_FILE && !m_manifestBuffer.isNull()); } -#endif // QCA2 +#endif // QCA2 && KF5Wallet diff --git a/libs/store/KoStore.cpp b/libs/store/KoStore.cpp --- a/libs/store/KoStore.cpp +++ b/libs/store/KoStore.cpp @@ -25,8 +25,9 @@ #include "KoTarStore.h" #include "KoZipStore.h" #include "KoDirectoryStore.h" -#ifdef QCA2 -#include "KoEncryptedStore.h" +#if defined QCA2 && defined KF5Wallet +# define HAVE_KOENCRYPTEDSTORE +# include "KoEncryptedStore.h" #endif #include @@ -78,16 +79,16 @@ case Tar: return new KoTarStore(fileName, mode, appIdentification, writeMimetype); case Zip: -#ifdef QCA2 +#ifdef HAVE_KOENCRYPTEDSTORE if (automatic && mode == Read) { // When automatically detecting, this might as well be an encrypted file. We'll need to check anyway, so we'll just use the encrypted store. return new KoEncryptedStore(fileName, Read, appIdentification, writeMimetype); } #endif return new KoZipStore(fileName, mode, appIdentification, writeMimetype); case Directory: return new KoDirectoryStore(fileName /* should be a dir name.... */, mode, writeMimetype); -#ifdef QCA2 +#ifdef HAVE_KOENCRYPTEDSTORE case Encrypted: return new KoEncryptedStore(fileName, mode, appIdentification, writeMimetype); #endif @@ -118,14 +119,14 @@ errorStore << "Can't create a Directory store for a memory buffer!" << endl; // fallback case Zip: -#ifdef QCA2 +#ifdef HAVE_KOENCRYPTEDSTORE if (automatic && mode == Read) { // When automatically detecting, this might as well be an encrypted file. We'll need to check anyway, so we'll just use the encrypted store. return new KoEncryptedStore(device, Read, appIdentification, writeMimetype); } #endif return new KoZipStore(device, mode, appIdentification, writeMimetype); -#ifdef QCA2 +#ifdef HAVE_KOENCRYPTEDSTORE case Encrypted: return new KoEncryptedStore(device, mode, appIdentification, writeMimetype); #endif @@ -164,14 +165,14 @@ case Tar: return new KoTarStore(window, url, tmpFile, mode, appIdentification); case Zip: -#ifdef QCA2 +#ifdef HAVE_KOENCRYPTEDSTORE if (automatic && mode == Read) { // When automatically detecting, this might as well be an encrypted file. We'll need to check anyway, so we'll just use the encrypted store. return new KoEncryptedStore(window, url, tmpFile, Read, appIdentification, writeMimetype); } #endif return new KoZipStore(window, url, tmpFile, mode, appIdentification, writeMimetype); -#ifdef QCA2 +#ifdef HAVE_KOENCRYPTEDSTORE case Encrypted: return new KoEncryptedStore(window, url, tmpFile, mode, appIdentification, writeMimetype); #endif diff --git a/libs/widgets/CMakeLists.txt b/libs/widgets/CMakeLists.txt --- a/libs/widgets/CMakeLists.txt +++ b/libs/widgets/CMakeLists.txt @@ -111,7 +111,7 @@ add_library(kowidgets SHARED ${kowidgets_LIB_SRCS}) generate_export_header(kowidgets BASE_NAME kowidgets) -target_link_libraries(kowidgets kotext pigmentcms kowidgetutils KF5::GuiAddons KF5::WidgetsAddons KF5::ConfigCore KF5::Codecs KF5::IconThemes ) +target_link_libraries(kowidgets kotext pigmentcms kowidgetutils KF5::GuiAddons KF5::WidgetsAddons KF5::Completion KF5::ConfigCore KF5::Codecs KF5::IconThemes KF5::KIOWidgets) if(GHNS) target_link_libraries(kowidgets KF5::NewStuff) @@ -122,7 +122,7 @@ endif() -target_link_libraries(kowidgets LINK_INTERFACE_LIBRARIES kotext pigmentcms kowidgetutils) +target_link_libraries(kowidgets LINK_INTERFACE_LIBRARIES kotext pigmentcms kowidgetutils KF5::Completion) set_target_properties(kowidgets PROPERTIES VERSION ${GENERIC_CALLIGRA_LIB_VERSION} SOVERSION ${GENERIC_CALLIGRA_LIB_SOVERSION} diff --git a/libs/widgets/tests/CMakeLists.txt b/libs/widgets/tests/CMakeLists.txt --- a/libs/widgets/tests/CMakeLists.txt +++ b/libs/widgets/tests/CMakeLists.txt @@ -8,9 +8,11 @@ ########### next target ############### +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS ThreadWeaver) + set(zoomhandler_test_SRCS zoomhandler_test.cpp ) kde4_add_unit_test(zoomhandler_test TESTNAME libs-widgets-zoomhandler_test ${zoomhandler_test_SRCS}) -target_link_libraries(zoomhandler_test kowidgets Qt5::Test) +target_link_libraries(zoomhandler_test kowidgets Qt5::Test KF5::ThreadWeaver) ########### next target ############### diff --git a/libs/widgetutils/CMakeLists.txt b/libs/widgetutils/CMakeLists.txt --- a/libs/widgetutils/CMakeLists.txt +++ b/libs/widgetutils/CMakeLists.txt @@ -15,7 +15,7 @@ generate_export_header(kowidgetutils BASE_NAME kowidgetutils) # KDE is only used for i18n -target_link_libraries(kowidgetutils Qt5::Core Qt5::Gui Qt5::Xml Qt5::Widgets KF5::I18n) +target_link_libraries(kowidgetutils Qt5::Core Qt5::Gui Qt5::Xml Qt5::Widgets KF5::I18n KF5::ConfigCore) target_link_libraries(kowidgetutils LINK_INTERFACE_LIBRARIES Qt5::Core Qt5::Gui Qt5::Widgets Qt5::Xml) set_target_properties(kowidgetutils diff --git a/plan/CMakeLists.txt b/plan/CMakeLists.txt --- a/plan/CMakeLists.txt +++ b/plan/CMakeLists.txt @@ -4,6 +4,8 @@ # set kplato debug area add_definitions( -DKDE_DEFAULT_DEBUG_AREA=42000 ) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS GuiAddons Parts) + if (KF5AkonadiContact_FOUND) add_definitions(-DPLAN_KDEPIMLIBS_FOUND) endif () diff --git a/plugins/textediting/spellcheck/CMakeLists.txt b/plugins/textediting/spellcheck/CMakeLists.txt --- a/plugins/textediting/spellcheck/CMakeLists.txt +++ b/plugins/textediting/spellcheck/CMakeLists.txt @@ -4,6 +4,8 @@ add_subdirectory( tests ) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS Sonnet) + include_directories( ${TEXTLAYOUT_INCLUDES} ${FLAKE_INCLUDES} ) set(spellcheck_SRCS diff --git a/sheets/CMakeLists.txt b/sheets/CMakeLists.txt --- a/sheets/CMakeLists.txt +++ b/sheets/CMakeLists.txt @@ -1,5 +1,8 @@ project(calligra-sheets) +find_package(KF5 ${MINIMUM_KF5_VERSION} REQUIRED COMPONENTS ThreadWeaver Sonnet) +find_package(Qt5 ${REQUIRED_QT_VERSION} OPTIONAL_COMPONENTS Sql) + include_directories( ${CMAKE_SOURCE_DIR}/interfaces ${KOMAIN_INCLUDES} ${KOTEXT_INCLUDES}