Warning, /utilities/krusader/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.16)
0002 
0003 project(krusader)
0004 
0005 set(VERSION "2.9.0-dev")
0006 set(RELEASE_NAME "Bleeding Edge")
0007 
0008 set(MIN_QT_VERSION 5.12)
0009 set(MIN_KF_VERSION 5.68)
0010 
0011 
0012 # ===== Packages =====
0013 
0014 find_package(ECM ${MIN_KF_VERSION} REQUIRED NO_MODULE)
0015 set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH})
0016 set(KDE_COMPILERSETTINGS_LEVEL "5.68")
0017 
0018 include(KDEInstallDirs)
0019 include(KDECMakeSettings)
0020 include(KDECompilerSettings NO_POLICY_SCOPE)
0021 
0022 include(ECMInstallIcons)
0023 include(ECMAddAppIcon)
0024 
0025 include(FeatureSummary)
0026 include(CheckIncludeFiles)
0027 
0028 find_package(Qt5 ${MIN_QT_VERSION} CONFIG REQUIRED
0029   Concurrent
0030   Core
0031   Gui
0032   DBus
0033   Widgets
0034   PrintSupport
0035   Xml
0036 )
0037 
0038 find_package(KF5 ${MIN_KF_VERSION} REQUIRED COMPONENTS
0039   Archive
0040   Bookmarks
0041   Codecs
0042   Completion
0043   CoreAddons
0044   Config
0045   DocTools
0046   I18n
0047   IconThemes
0048   ItemViews
0049   KIO
0050   Notifications
0051   Parts
0052   Solid
0053   TextWidgets
0054   Wallet
0055   WidgetsAddons
0056   WindowSystem
0057   XmlGui
0058   GuiAddons
0059 )
0060 
0061 
0062 # ===== Get GIT revision =====
0063 
0064 execute_process(COMMAND git log --pretty=format:%h -n 1
0065                 WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
0066                 OUTPUT_VARIABLE GIT_REVISION
0067                 ERROR_QUIET)
0068 
0069 # ===== Definitions =====
0070 
0071 # Synchronizer is enabled by default, unless disabled from the command line (-DENABLE_SYNCHRONIZER=OFF)
0072 option(ENABLE_SYNCHRONIZER "Enable Synchronizer" ON)
0073 
0074 # If an old setting is being used, use the setting that complies with the structure of other Krusader settings.
0075 if(ENABLE_SYNCHRONIZER)
0076     set(SYNCHRONIZER_ENABLED TRUE)
0077     add_definitions(-DSYNCHRONIZER_ENABLED)
0078 else()
0079     set(SYNCHRONIZER_ENABLED FALSE)
0080 endif()
0081 
0082 # For security reasons, absolute kdesu path is set at build time and is not configurable.
0083 if(NOT KDESU_PATH)
0084     if(EXISTS "${KDE_INSTALL_FULL_LIBDIR}/kf5/kdesu")
0085       # Used by Arch distribution
0086       set(KDESU_PATH "${KDE_INSTALL_FULL_LIBDIR}/kf5/kdesu")
0087     else()
0088       set(KDESU_PATH "${KDE_INSTALL_FULL_LIBEXECDIR_KF5}/kdesu")
0089     endif()
0090 endif()
0091 add_definitions(-DKDESU_PATH="${KDESU_PATH}")
0092 message(STATUS "kdesu path has been hard-coded: ${KDESU_PATH}")
0093 
0094 add_definitions(${QT_DEFINITIONS} ${KF5_DEFINITIONS})
0095 
0096 add_definitions(-DKRARC_ENABLED)
0097 add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
0098 
0099 # Enable Krarc query, since MIN_KF_VERSION >= 5.23
0100 add_definitions(-DKRARC_QUERY_ENABLED)
0101 
0102 
0103 # ===== Additional checks =====
0104 
0105 if (NOT CMAKE_INSTALL_PREFIX MATCHES "^/usr(/local)?/?$" AND NOT DEFINED KDE_INSTALL_QTPLUGINDIR
0106         AND NOT DEFINED KDE_INSTALL_USE_QT_SYS_PATHS)
0107     message(WARNING "CMAKE_INSTALL_PREFIX is not set to a standard location (/usr or /usr/local), \
0108                      krarc:/ protocol may not work. To force installing plugins into standard location \
0109                      use -DKDE_INSTALL_USE_QT_SYS_PATHS=true")
0110 endif()
0111 
0112 
0113 # ===== ACL support =====
0114 
0115 check_include_files(attr/libattr.h HAVE_ATTR_LIBATTR_H)
0116 check_include_files(sys/xattr.h HAVE_SYS_XATTR_H)
0117 check_include_files(sys/acl.h HAVE_SYS_ACL_H)
0118 check_include_files(acl/libacl.h HAVE_ACL_LIBACL_H)
0119 
0120 if (HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H)
0121     set(ACL_HEADERS_FOUND TRUE)
0122 endif(HAVE_ATTR_LIBATTR_H AND HAVE_SYS_XATTR_H AND HAVE_SYS_ACL_H AND HAVE_ACL_LIBACL_H)
0123 
0124 if (ACL_HEADERS_FOUND)
0125     find_library(ACL_LIBS NAMES acl)
0126     find_library(ATTR_LIBS NAMES attr)
0127 endif(ACL_HEADERS_FOUND)
0128 
0129 if (ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS)
0130     set(ACL_FOUND TRUE)
0131     set(ACL_LIBS ${ACL_LIBS} ${ATTR_LIBS})
0132     message(STATUS "Found ACL support: ${ACL_LIBS}")
0133     add_definitions(-DHAVE_POSIX_ACL)
0134 endif(ACL_HEADERS_FOUND AND ACL_LIBS AND ATTR_LIBS)
0135 
0136 
0137 # ===== Compile options =====
0138 
0139 if (CMAKE_COMPILER_IS_GNUCXX)
0140     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fno-common -ansi -Wpedantic -Wconversion -Wpointer-arith \
0141                          -Wcast-qual -Wcast-align -Wwrite-strings -Wsuggest-override -Wfloat-equal \
0142                          -Woverloaded-virtual -Wundef -Wlogical-op -Wuninitialized -Wredundant-decls -Wnoexcept \
0143                          -Wnon-virtual-dtor -Wctor-dtor-privacy -Wzero-as-null-pointer-constant" CACHE STRING "" FORCE)
0144 endif()
0145 
0146 
0147 # ===== Subdirectories =====
0148 
0149 add_subdirectory(app)
0150 add_subdirectory(doc/handbook)
0151 add_subdirectory(plugins/iso)
0152 add_subdirectory(plugins/krarc)
0153 
0154 
0155 # ===== Translations =====
0156 
0157 ki18n_install(po)
0158 kdoctools_install(po)
0159 
0160 
0161 # ===== Output configuration =====
0162 
0163 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)