Change in kio[master]: KIO: add option KIOCORE_ONLY.

David Faure (Code Review) noreply at kde.org
Wed Jan 14 10:20:41 UTC 2015


David Faure has uploaded a new change for review.

  https://gerrit.vesnicky.cesnet.cz/r/322

Change subject: KIO: add option KIOCORE_ONLY.
......................................................................

KIO: add option KIOCORE_ONLY.

This allows to build only KIOCore, with its helper programs and unittests.

It reduces greatly the amount of required dependencies compared to what is
needed to compile KIOWidgets+KIOFileWidgets, so the cmake option is useful
for projects/companies that only need KIOCore.

Change-Id: I422cf15deb0a3435a1c0921fdada152814ce5db6
---
M CMakeLists.txt
M KF5KIOConfig.cmake.in
M autotests/CMakeLists.txt
M src/CMakeLists.txt
M src/ioslaves/http/CMakeLists.txt
M src/ioslaves/http/kcookiejar/CMakeLists.txt
M src/ioslaves/trash/CMakeLists.txt
7 files changed, 39 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.vesnicky.cesnet.cz:29418/kio refs/changes/22/322/1

diff --git a/CMakeLists.txt b/CMakeLists.txt
index aafc671..7fe0be5 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,6 +16,7 @@
 include(ECMMarkAsTest)
 include(ECMSetupVersion)
 include(ECMGenerateHeaders)
+include(ECMMarkNonGuiExecutable)
 
 set(KF5_VERSION "5.7.0") # handled by release scripts
 set(KF5_DEP_VERSION "5.6.0") # handled by release scripts
@@ -27,21 +28,27 @@
   PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/KF5KIOConfigVersion.cmake"
   SOVERSION 5)
 
-find_package(KF5Bookmarks ${KF5_DEP_VERSION} REQUIRED)
-find_package(KF5Completion ${KF5_DEP_VERSION} REQUIRED)
+option(KIOCORE_ONLY "Only compile KIOCore, not KIOWidgets or anything that depends on it. This will disable support for cookies and passwordhandling (prompting and storing)." OFF)
+
+find_package(KF5Archive ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5Config ${KF5_DEP_VERSION} REQUIRED)
-find_package(KF5ConfigWidgets ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5CoreAddons ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5DBusAddons ${KF5_DEP_VERSION} REQUIRED)
-find_package(KF5DocTools ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5I18n ${KF5_DEP_VERSION} REQUIRED)
+find_package(KF5Service ${KF5_DEP_VERSION} REQUIRED)
+find_package(KF5DocTools ${KF5_DEP_VERSION} REQUIRED)
+find_package(KF5Solid ${KF5_DEP_VERSION} REQUIRED) # for kio_trash
+
+if (NOT KIOCORE_ONLY)
+find_package(KF5Bookmarks ${KF5_DEP_VERSION} REQUIRED)
+find_package(KF5Completion ${KF5_DEP_VERSION} REQUIRED)
+find_package(KF5ConfigWidgets ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5IconThemes ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5ItemViews ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5JobWidgets ${KF5_DEP_VERSION} REQUIRED)
-find_package(KF5Service ${KF5_DEP_VERSION} REQUIRED)
-find_package(KF5Solid ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5WidgetsAddons ${KF5_DEP_VERSION} REQUIRED)
 find_package(KF5WindowSystem ${KF5_DEP_VERSION} REQUIRED)
+endif()
 
 # TODO: Remove these
 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
@@ -73,11 +80,16 @@
     ki18n_install(po)
     kdoctools_install(po)
 endif()
+if (KF5DocTools_FOUND)
 add_subdirectory(docs)
+endif()
 include(CheckLibraryExists)
 add_subdirectory(src)
 add_subdirectory(autotests)
+
+if (NOT KIOCORE_ONLY)
 add_subdirectory(tests)
+endif()
 
 # create a Config.cmake and a ConfigVersion.cmake file and install them
 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/KF5KIO")
diff --git a/KF5KIOConfig.cmake.in b/KF5KIOConfig.cmake.in
index 80ee54f..68cb83d 100644
--- a/KF5KIOConfig.cmake.in
+++ b/KF5KIOConfig.cmake.in
@@ -5,13 +5,18 @@
 set(KCookieServer_DBUS_INTERFACE "${PACKAGE_PREFIX_DIR}/@DBUS_INTERFACES_INSTALL_DIR@/kf5_org.kde.KCookieServer.xml")
 set(KSlaveLauncher_DBUS_INTERFACE "${PACKAGE_PREFIX_DIR}/@DBUS_INTERFACES_INSTALL_DIR@/kf5_org.kde.KSlaveLauncher.xml")
 
+find_dependency(KF5CoreAddons "@KF5_DEP_VERSION@")
+find_dependency(KF5Config "@KF5_DEP_VERSION@")
+find_dependency(KF5Service "@KF5_DEP_VERSION@")
+
+if (NOT @KIOCORE_ONLY@)
 find_dependency(KF5Bookmarks "@KF5_DEP_VERSION@")
 find_dependency(KF5Completion "@KF5_DEP_VERSION@")
 find_dependency(KF5ItemViews "@KF5_DEP_VERSION@")
 find_dependency(KF5JobWidgets "@KF5_DEP_VERSION@")
-find_dependency(KF5Service "@KF5_DEP_VERSION@")
 find_dependency(KF5Solid "@KF5_DEP_VERSION@")
 find_dependency(KF5XmlGui "@KF5_DEP_VERSION@")
+endif()
 
 find_dependency(Qt5Network "@REQUIRED_QT_VERSION@")
 
diff --git a/autotests/CMakeLists.txt b/autotests/CMakeLists.txt
index 9d3b643..1c267d1 100644
--- a/autotests/CMakeLists.txt
+++ b/autotests/CMakeLists.txt
@@ -45,6 +45,7 @@
   )
 endif()
 
+if (TARGET KF5::KIOWidgets)
 ecm_add_tests(
  clipboardupdatertest.cpp
  dropjobtest.cpp
@@ -63,7 +64,9 @@
 )
 
 set_target_properties(krununittest PROPERTIES COMPILE_FLAGS "-DCMAKE_INSTALL_FULL_LIBEXECDIR_KF5=\\\"${CMAKE_INSTALL_FULL_LIBEXECDIR_KF5}\\\"")
+endif()
 
+if (TARGET KF5::KIOFileWidgets)
 include_directories(${CMAKE_SOURCE_DIR}/src/filewidgets ${CMAKE_BINARY_DIR}/src/filewidgets)
 ecm_add_tests(
  kurlnavigatortest.cpp
@@ -73,4 +76,5 @@
  NAME_PREFIX "kiofilewidgets-"
  LINK_LIBRARIES KF5::KIOFileWidgets KF5::KIOWidgets KF5::Bookmarks Qt5::Test
 )
+endif()
 
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 216f300..6405e5c 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,12 +1,16 @@
 add_subdirectory(core)
-add_subdirectory(widgets)
-add_subdirectory(filewidgets)
+
+# KIOCore-only libs
 add_subdirectory(kntlm)
 add_subdirectory(ioslaves)
 add_subdirectory(kssld)
 add_subdirectory(kioslave)
-add_subdirectory(kioexec)
+
+if (NOT KIOCORE_ONLY)
 add_subdirectory(kpasswdserver)
+add_subdirectory(widgets)
+add_subdirectory(filewidgets)
+add_subdirectory(kioexec)
 add_subdirectory(urifilters)
 add_subdirectory(kcms)
 
@@ -14,3 +18,4 @@
   # arpa/nameser.h
   add_subdirectory(kpac)
 endif()
+endif()
diff --git a/src/ioslaves/http/CMakeLists.txt b/src/ioslaves/http/CMakeLists.txt
index 11ed517..76a8e28 100644
--- a/src/ioslaves/http/CMakeLists.txt
+++ b/src/ioslaves/http/CMakeLists.txt
@@ -27,7 +27,9 @@
 
 remove_definitions(-DQT_NO_CAST_FROM_ASCII)
 
+if (NOT KIOCORE_ONLY)
 add_subdirectory( kcookiejar )
+endif()
 
 ########### next target ###############
 
diff --git a/src/ioslaves/http/kcookiejar/CMakeLists.txt b/src/ioslaves/http/kcookiejar/CMakeLists.txt
index 07d5554..40b4bfd 100644
--- a/src/ioslaves/http/kcookiejar/CMakeLists.txt
+++ b/src/ioslaves/http/kcookiejar/CMakeLists.txt
@@ -1,5 +1,3 @@
-include(ECMMarkNonGuiExecutable)
-
 ####### kcookiejar: command line tool for talking to the kded kcookiejar module #######
 qt5_generate_dbus_interface(${CMAKE_CURRENT_SOURCE_DIR}/kcookieserver.h org.kde.KCookieServer.xml)
 set(kcookieserver_xml ${CMAKE_CURRENT_BINARY_DIR}/org.kde.KCookieServer.xml)
diff --git a/src/ioslaves/trash/CMakeLists.txt b/src/ioslaves/trash/CMakeLists.txt
index b07af4f..05161cd 100644
--- a/src/ioslaves/trash/CMakeLists.txt
+++ b/src/ioslaves/trash/CMakeLists.txt
@@ -58,7 +58,7 @@
 ########### next target ###############
 
 # currently not on win32, TODO!
-if(NOT WIN32)
+if(NOT WIN32 AND NOT KIOCORE_ONLY)
     set(kcm_trash_PART_SRCS kcmtrash.cpp ${trashcommon_PART_SRCS})
     add_library(kcm_trash MODULE ${kcm_trash_PART_SRCS})
     target_link_libraries(kcm_trash

-- 
To view, visit https://gerrit.vesnicky.cesnet.cz/r/322
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I422cf15deb0a3435a1c0921fdada152814ce5db6
Gerrit-PatchSet: 1
Gerrit-Project: kio
Gerrit-Branch: master
Gerrit-Owner: David Faure <faure at kde.org>
Gerrit-Reviewer: Aleix Pol Gonzalez <aleixpol at kde.org>
Gerrit-Reviewer: Nicolás Alvarez <nicolas.alvarez at gmail.com>
Gerrit-Reviewer: Sysadmin Testing Account <null at kde.org>


More information about the Kde-frameworks-devel mailing list