CMakeLists.txt 3.54 KB
Newer Older
1
cmake_minimum_required (VERSION 3.0)
2

3
# KDE Application Version, managed by release script
4
set (RELEASE_SERVICE_VERSION_MAJOR "20")
5
set (RELEASE_SERVICE_VERSION_MINOR "11")
6 7 8
set (RELEASE_SERVICE_VERSION_MICRO "70")
set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
project(ark VERSION ${RELEASE_SERVICE_VERSION})
9

10
set(QT_MIN_VERSION 5.12.0)
11
set(KF5_MIN_VERSION 5.71.0)
12

13
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Ragnar Thomsen's avatar
Ragnar Thomsen committed
14
set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
Nicolás Alvarez's avatar
Nicolás Alvarez committed
15

Bhushan Shah's avatar
Bhushan Shah committed
16 17
include(KDEInstallDirs)
include(KDECMakeSettings)
18
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
19
include(GenerateExportHeader)
20
include(FeatureSummary)
21
include(ECMQtDeclareLoggingCategory)
22
include(ECMSetupVersion)
23

Laurent Montel's avatar
Laurent Montel committed
24 25 26
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)

27
ecm_setup_version(${RELEASE_SERVICE_VERSION}
28 29
                  VARIABLE_PREFIX ARK
                  VERSION_HEADER "ark_version.h")
30

31 32
ecm_setup_version(PROJECT
                  VARIABLE_PREFIX KERFUFFLE)
33

34
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED
35
    Concurrent
36 37 38
    Core
    Gui
    Widgets)
39 40
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS Archive
                                                        Config
41
                                                        Crash
42 43 44
                                                        DBusAddons
                                                        DocTools
                                                        I18n
Ragnar Thomsen's avatar
Ragnar Thomsen committed
45
                                                        ItemModels
46 47
                                                        KIO
                                                        Service
48
                                                        Parts
49 50
                                                        Pty
                                                        WidgetsAddons)
51

52 53 54 55
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG QUIET)
set_package_properties(Qt5Test PROPERTIES
    PURPOSE "Required for tests"
    TYPE OPTIONAL)
56 57

if(NOT Qt5Test_FOUND)
58 59 60
    set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
endif()

Elvis Angelaccio's avatar
Elvis Angelaccio committed
61
find_package(LibArchive 3.3.3 REQUIRED)
62
set_package_properties(LibArchive PROPERTIES
63
                       URL "https://www.libarchive.org/"
64 65 66
                       DESCRIPTION "A library for dealing with a wide variety of archive file formats"
                       PURPOSE "Required for among others tar, tar.gz, tar.bz2 formats in Ark.")

67
find_package(LibZip 1.3.0)
Ragnar Thomsen's avatar
Ragnar Thomsen committed
68 69 70 71 72
set_package_properties(LibZip PROPERTIES
                       URL "https://nih.at/libzip/"
                       DESCRIPTION "A library for handling zip archives"
                       PURPOSE "Optional for zip archives.")

73 74 75 76 77 78 79
option(WITH_TEST_COVERAGE "Build with test coverage support" OFF)
if (WITH_TEST_COVERAGE)
    set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage")
    set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} --coverage")
endif (WITH_TEST_COVERAGE)

80 81
set(SUPPORTED_ARK_MIMETYPES "")

Lukáš Tinkl's avatar
Lukáš Tinkl committed
82
add_definitions(-DTRANSLATION_DOMAIN="ark")
Laurent Montel's avatar
Laurent Montel committed
83
add_definitions(-DQT_NO_FOREACH)
Lukáš Tinkl's avatar
Lukáš Tinkl committed
84

Bhushan Shah's avatar
Bhushan Shah committed
85
add_subdirectory(plugins)
86
add_subdirectory(kerfuffle)
Bhushan Shah's avatar
Bhushan Shah committed
87
add_subdirectory(part)
Bhushan Shah's avatar
Bhushan Shah committed
88
add_subdirectory(app)
Laurent Montel's avatar
Laurent Montel committed
89
add_subdirectory(doc)
Bhushan Shah's avatar
Bhushan Shah committed
90

91 92 93
if(BUILD_TESTING)
    add_subdirectory(autotests)
endif()
94

95
ki18n_install(po)
96
kdoctools_install(po)
97

Laurent Montel's avatar
Laurent Montel committed
98
install(FILES ark.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
99

Ragnar Thomsen's avatar
Ragnar Thomsen committed
100
feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)