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

3
# KDE Application Version, managed by release script
4
set (KDE_APPLICATIONS_VERSION_MAJOR "19")
5
set (KDE_APPLICATIONS_VERSION_MINOR "07")
6
set (KDE_APPLICATIONS_VERSION_MICRO "70")
7
8
set (KDE_APPLICATIONS_VERSION "${KDE_APPLICATIONS_VERSION_MAJOR}.${KDE_APPLICATIONS_VERSION_MINOR}.${KDE_APPLICATIONS_VERSION_MICRO}")

9
10
project(gwenview VERSION ${KDE_APPLICATIONS_VERSION})

Halla Rempt's avatar
Halla Rempt committed
11
12
set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake )

13
14
set (QT_MIN_VERSION "5.9.0")
set (KF5_MIN_VERSION "5.43.0")
15

16
find_package(ECM ${KF5_MIN_VERSION} REQUIRED NO_MODULE)
Csaba Kertesz's avatar
Csaba Kertesz committed
17

18
19
20
21
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR})

include(KDEInstallDirs)
include(KDECMakeSettings)
22
include(KDECompilerSettings NO_POLICY_SCOPE)
23
24
25
26
27
include(ECMOptionalAddSubdirectory)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMMarkNonGuiExecutable)
include(ECMGenerateHeaders)
Lukáš Tinkl's avatar
Lukáš Tinkl committed
28
include(ECMAddAppIcon)
29
30
31
include(GenerateExportHeader)
include(FeatureSummary)

32
33
34
35
36
## Generate header with version number
ecm_setup_version(${KDE_APPLICATIONS_VERSION}
                  VARIABLE_PREFIX GWENVIEW
                  VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/lib/gwenview_version.h"
)
37

Aurélien Gâteau's avatar
Aurélien Gâteau committed
38
## CMake options
Aurélien Gâteau's avatar
Aurélien Gâteau committed
39
40
set(GWENVIEW_SEMANTICINFO_BACKEND_NONE OFF)
set(GWENVIEW_SEMANTICINFO_BACKEND_FAKE OFF)
Vishesh Handa's avatar
Vishesh Handa committed
41
set(GWENVIEW_SEMANTICINFO_BACKEND_BALOO OFF)
42

Lukáš Tinkl's avatar
Lukáš Tinkl committed
43
set(GWENVIEW_SEMANTICINFO_BACKEND "Baloo" CACHE STRING "Semantic info backend for Gwenview (Baloo/Fake/None)")
44

Aurélien Gâteau's avatar
Aurélien Gâteau committed
45
# Init GWENVIEW_SEMANTICINFO_BACKEND_* vars
Lukáš Tinkl's avatar
Lukáš Tinkl committed
46
if(GWENVIEW_SEMANTICINFO_BACKEND STREQUAL "None")
47
    set(GWENVIEW_SEMANTICINFO_BACKEND_NONE ON)
Lukáš Tinkl's avatar
Lukáš Tinkl committed
48
elseif(GWENVIEW_SEMANTICINFO_BACKEND STREQUAL "Fake")
Aurélien Gâteau's avatar
Aurélien Gâteau committed
49
    set(GWENVIEW_SEMANTICINFO_BACKEND_FAKE ON)
50
else()
Vishesh Handa's avatar
Vishesh Handa committed
51
    set(GWENVIEW_SEMANTICINFO_BACKEND_BALOO ON)
52
endif()
53

54
find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED Core Widgets Concurrent Svg OpenGL PrintSupport)
55
56
find_package(Qt5DBus ${QT_MIN_VERSION} CONFIG QUIET)
set(HAVE_QTDBUS ${Qt5DBus_FOUND})
57

Christoph Feck's avatar
Christoph Feck committed
58
find_package(Phonon4Qt5 4.6.60 NO_MODULE REQUIRED)
David Edmundson's avatar
David Edmundson committed
59
60
61
include_directories(BEFORE ${PHONON_INCLUDES})
add_definitions(-DPHONON_LIB_SONAME=\"${PHONON_LIB_SONAME}\")

62
find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS
63
    KIO
64
    ItemModels
65
66
67
68
69
70
    I18n
    DocTools
    Parts
    WindowSystem
    IconThemes
    Notifications
71
    Purpose
72
    WidgetsAddons
73
)
74
75
76
find_package(KF5 ${KF5_MIN_VERSION} OPTIONAL_COMPONENTS
    Activities
)
77

Aurélien Gâteau's avatar
Aurélien Gâteau committed
78
79
## Dependencies
find_package(JPEG)
80
set_package_properties(JPEG PROPERTIES URL "http://libjpeg.sourceforge.net/" DESCRIPTION "JPEG image manipulation support" TYPE REQUIRED)
Aurélien Gâteau's avatar
Aurélien Gâteau committed
81

82
find_package(PNG)
83
set_package_properties(PNG PROPERTIES URL "http://www.libpng.org" DESCRIPTION "PNG image manipulation support" TYPE REQUIRED)
84

Aurélien Gâteau's avatar
Aurélien Gâteau committed
85
find_package(Exiv2)
Christoph Feck's avatar
Christoph Feck committed
86
set_package_properties(Exiv2 PROPERTIES URL "http://www.exiv2.org" DESCRIPTION "image metadata support" TYPE REQUIRED)
Aurélien Gâteau's avatar
Aurélien Gâteau committed
87

Csaba Kertesz's avatar
Csaba Kertesz committed
88
find_package(CFitsio)
Andreas Sturmlechner's avatar
Andreas Sturmlechner committed
89
90
91
92
set_package_properties(CFitsio PROPERTIES URL "http://heasarc.gsfc.nasa.gov/fitsio/fitsio.html" DESCRIPTION "FITS format support" TYPE OPTIONAL)
if(CFITSIO_FOUND)
    set(HAVE_FITS true)
endif()
Csaba Kertesz's avatar
Csaba Kertesz committed
93

Laurent Montel's avatar
Laurent Montel committed
94
find_package(KF5Kipi)
95
96
97
if (KF5Kipi_FOUND)
   set(KIPI_FOUND true)
endif()
98
set_package_properties(KF5Kipi PROPERTIES URL "https://phabricator.kde.org/source/kipi-plugins/" DESCRIPTION "Provides various image manipulation and export features" TYPE OPTIONAL)
Aurélien Gâteau's avatar
Aurélien Gâteau committed
99

Halla Rempt's avatar
Halla Rempt committed
100
find_package(LCMS2)
101
set_package_properties(LCMS2 PROPERTIES URL "http://www.littlecms.com" DESCRIPTION "Color management engine" TYPE REQUIRED)
Halla Rempt's avatar
Halla Rempt committed
102

103
104
105
106
107
108
109
110
if (GWENVIEW_SEMANTICINFO_BACKEND_BALOO)
    find_package(KF5Baloo 5.1.90)
    set_package_properties(KF5Baloo PROPERTIES URL "https://projects.kde.org/projects/kde/kdelibs/baloo" DESCRIPTION "Desktop-wide semantic information support" TYPE OPTIONAL)
    if (NOT KF5Baloo_FOUND)
        message (STATUS "You have selected Baloo for semantic backend, but required version was not found. Overriding the backend to None")
        unset(GWENVIEW_SEMANTICINFO_BACKEND_BALOO)
        set(GWENVIEW_SEMANTICINFO_BACKEND_NONE ON)
    endif ()
111
endif ()
112

113
114
115
116
find_package(KF5KDcraw)
if (KF5KDcraw_FOUND)
   add_definitions(-DKDCRAW_FOUND)
endif()
117
set_package_properties(KF5KDcraw PROPERTIES URL "https://phabricator.kde.org/source/libkdcraw/" DESCRIPTION "C++ interface around LibRaw library used to decode RAW picture files" TYPE OPTIONAL)
Christophe Giboudeaux's avatar
Christophe Giboudeaux committed
118

Lukáš Tinkl's avatar
Lukáš Tinkl committed
119
120
121
122
123
124
125

find_package(X11)
if(X11_FOUND)
   find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED X11Extras)
   set(HAVE_X11 1)
endif()

David Edmundson's avatar
David Edmundson committed
126
127
128
configure_file(config-gwenview.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-gwenview.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})

129
add_definitions(-DQT_NO_URL_CAST_FROM_STRING)
Lukáš Tinkl's avatar
Lukáš Tinkl committed
130

131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
function(JoinListAsString VALUES GLUE OUTPUT)
    string(REPLACE ";" "${GLUE}" _TMP_STR "${VALUES}")
    set(${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
endfunction()

set(IMAGE_MIME_TYPES_LIST
    image/gif
    image/jpeg
    image/png
    image/bmp
    image/x-eps
    image/x-icns
    image/x-ico
    image/x-portable-bitmap
    image/x-portable-graymap
    image/x-portable-pixmap
    image/x-xbitmap
    image/x-xpixmap
    image/tiff
    image/x-psd
    image/x-webp
    image/webp
    image/x-tga
154
    application/x-krita
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
)
if (KF5KDcraw_FOUND)
    list(APPEND IMAGE_MIME_TYPES_LIST
        image/x-kde-raw
        image/x-canon-cr2
        image/x-canon-crw
        image/x-kodak-dcr
        image/x-adobe-dng
        image/x-kodak-k25
        image/x-kodak-kdc
        image/x-minolta-mrw
        image/x-nikon-nef
        image/x-olympus-orf
        image/x-pentax-pef
        image/x-fuji-raf
        image/x-panasonic-rw
        image/x-sony-sr2
        image/x-sony-srf
        image/x-sigma-x3f
        image/x-sony-arw
        image/x-panasonic-rw2
    )
endif()
JoinListAsString("${IMAGE_MIME_TYPES_LIST}" ";" IMAGE_MIME_TYPES)

Aurélien Gâteau's avatar
Aurélien Gâteau committed
180
## dirs to build
David Edmundson's avatar
David Edmundson committed
181
add_subdirectory(lib)
182
add_subdirectory(app)
183
add_subdirectory(importer)
184
add_subdirectory(part)
David Edmundson's avatar
David Edmundson committed
185
add_subdirectory(tests)
David Edmundson's avatar
David Edmundson committed
186
187
188
189
add_subdirectory(icons)
add_subdirectory(images)
add_subdirectory(cursors)
add_subdirectory(color-schemes)
190
add_subdirectory(doc)
191
add_subdirectory(kconf_update)
Lukáš Tinkl's avatar
Lukáš Tinkl committed
192
193

feature_summary(WHAT ALL INCLUDE_QUIET_PACKAGES FATAL_ON_MISSING_REQUIRED_PACKAGES)