CMakeLists.txt 3.68 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
cmake_minimum_required (VERSION 3.16 FATAL_ERROR)
2

3
# KDE Application Version, managed by release script
4
set (RELEASE_SERVICE_VERSION_MAJOR "21")
5
set (RELEASE_SERVICE_VERSION_MINOR "07")
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

Laurent Montel's avatar
Laurent Montel committed
10
11
set(QT_MIN_VERSION 5.15.0)
set(KF5_MIN_VERSION 5.82.0)
12

Nicolas Fella's avatar
Nicolas Fella committed
13
14
15
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

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

Bhushan Shah's avatar
Bhushan Shah committed
19
20
include(KDEInstallDirs)
include(KDECMakeSettings)
21
include(KDEFrameworkCompilerSettings NO_POLICY_SCOPE)
22
include(GenerateExportHeader)
23
include(FeatureSummary)
24
include(ECMQtDeclareLoggingCategory)
25
include(ECMSetupVersion)
26

Laurent Montel's avatar
Laurent Montel committed
27
28
29
add_definitions(-DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT)
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)

30
ecm_setup_version(${RELEASE_SERVICE_VERSION}
31
32
                  VARIABLE_PREFIX ARK
                  VERSION_HEADER "ark_version.h")
33

34
35
ecm_setup_version(PROJECT
                  VARIABLE_PREFIX KERFUFFLE)
36

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

55
56
57
58
find_package(Qt5Test ${QT_MIN_VERSION} CONFIG QUIET)
set_package_properties(Qt5Test PROPERTIES
    PURPOSE "Required for tests"
    TYPE OPTIONAL)
59
60

if(NOT Qt5Test_FOUND)
61
62
63
    set(BUILD_TESTING OFF CACHE BOOL "Build the testing tree.")
endif()

Elvis Angelaccio's avatar
Elvis Angelaccio committed
64
find_package(LibArchive 3.3.3 REQUIRED)
65
set_package_properties(LibArchive PROPERTIES
66
                       URL "https://www.libarchive.org/"
67
68
69
                       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.")

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

76
77
78
79
80
81
82
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)

83
84
set(SUPPORTED_ARK_MIMETYPES "")

Lukáš Tinkl's avatar
Lukáš Tinkl committed
85
add_definitions(-DTRANSLATION_DOMAIN="ark")
Laurent Montel's avatar
Laurent Montel committed
86
add_definitions(-DQT_NO_FOREACH)
Alexander Lohnau's avatar
Alexander Lohnau committed
87
add_definitions(-DQT_NO_KEYWORDS)
Lukáš Tinkl's avatar
Lukáš Tinkl committed
88

Bhushan Shah's avatar
Bhushan Shah committed
89
add_subdirectory(plugins)
90
add_subdirectory(kerfuffle)
Bhushan Shah's avatar
Bhushan Shah committed
91
add_subdirectory(part)
Bhushan Shah's avatar
Bhushan Shah committed
92
add_subdirectory(app)
Laurent Montel's avatar
Laurent Montel committed
93
add_subdirectory(doc)
Bhushan Shah's avatar
Bhushan Shah committed
94

95
96
97
if(BUILD_TESTING)
    add_subdirectory(autotests)
endif()
98

99
ki18n_install(po)
100
kdoctools_install(po)
101

Laurent Montel's avatar
Laurent Montel committed
102
ecm_qt_install_logging_categories(EXPORT ARK FILE ark.categories DESTINATION ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
Laurent Montel's avatar
Laurent Montel committed
103

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