CMakeLists.txt 9.3 KB
Newer Older
1
add_definitions(-DTRANSLATION_DOMAIN=\"kio5_thumbnail\")
Lukáš Tinkl's avatar
Lukáš Tinkl committed
2

3
4
5
6
find_package(OpenEXR 3.0 CONFIG QUIET)
if(NOT OpenEXR_FOUND)
    find_package(OpenEXR)
endif()
7
set_package_properties(OpenEXR PROPERTIES DESCRIPTION "API for accessing OpenEXR formatted images"
8
                       URL "https://www.openexr.com"
9
10
11
12
                       TYPE OPTIONAL
                       PURPOSE "Provides support for OpenEXR formatted images in the thumbnail kioslave"
                      )

13
find_package(libappimage 0.1.10 CONFIG)
Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
14
set_package_properties(libappimage PROPERTIES DESCRIPTION "Core library of the AppImage project"
Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
15
16
17
18
19
                       URL "https://github.com/AppImage/libappimage"
                       TYPE OPTIONAL
                       PURPOSE "Provides support for AppImage thumbnails"
                       )

Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
20
21
22
23
24
25
26
find_package(X11)
set_package_properties(X11 PROPERTIES DESCRIPTION "X11 libraries"
                        URL "https://www.x.org"
                        TYPE OPTIONAL
                        PURPOSE "Provides support for XCursor thumbnails"
                    )

27
28
include_directories(${CMAKE_BINARY_DIR})

29
30
########### next target ###############

31
set(kio_thumbnail_PART_SRCS thumbnail.cpp imagefilter.cpp)
32

33
34
35
36
37
ecm_qt_declare_logging_category(kio_thumbnail_PART_SRCS
                                HEADER thumbnail-logsettings.h
                                IDENTIFIER KIO_THUMBNAIL_LOG
                                CATEGORY_NAME log_kio_thumbnail)

38
add_library(kio_thumbnail MODULE ${kio_thumbnail_PART_SRCS})
39

Sebastian Kügler's avatar
Sebastian Kügler committed
40
target_link_libraries(kio_thumbnail
Aurélien Gâteau's avatar
Aurélien Gâteau committed
41
	KF5::CoreAddons
Sebastian Kügler's avatar
Sebastian Kügler committed
42
43
	KF5::KIOCore
	KF5::KIOWidgets
44
	KF5::I18n
Sebastian Kügler's avatar
Sebastian Kügler committed
45
)
46

47
48
set_target_properties(kio_thumbnail PROPERTIES OUTPUT_NAME "thumbnail")

49
install(TARGETS kio_thumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf5/kio)
50
51
52

########### next target ###############

53
set(imagethumbnail_PART_SRCS imagecreator.cpp)
54

55
add_library(imagethumbnail MODULE ${imagethumbnail_PART_SRCS})
56

Sebastian Kügler's avatar
Sebastian Kügler committed
57
target_link_libraries(imagethumbnail
58
    KF5::KIOWidgets
Sebastian Kügler's avatar
Sebastian Kügler committed
59
)
60

61
install(TARGETS imagethumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
62

Pascal Létourneau's avatar
Pascal Létourneau committed
63
64
########### next target ###############

65
install( FILES directorythumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
66

67
68
########### next target ###############

Marco Martin's avatar
Marco Martin committed
69
set(jpegthumbnail_PART_SRCS jpegcreator.cpp)
70
kconfig_add_kcfg_files(jpegthumbnail_PART_SRCS jpegcreatorsettings5.kcfgc)
71
add_library(jpegthumbnail MODULE ${jpegthumbnail_PART_SRCS})
72

73
target_link_libraries(jpegthumbnail
Sebastian Kügler's avatar
Sebastian Kügler committed
74
75
76
77
	Qt5::Core
	Qt5::Gui
	KF5::KIOCore
	KF5::KIOWidgets
78
79
	KF5::I18n
	KF5::ConfigCore
Aurélien Gâteau's avatar
Aurélien Gâteau committed
80
	KF5::ConfigGui
Sebastian Kügler's avatar
Sebastian Kügler committed
81
82
)

83
84
install(FILES jpegcreatorsettings5.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
install(TARGETS jpegthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
Marco Martin's avatar
Marco Martin committed
85
86

########### next target ###############
87
88
89
90
91
92
93
94
95
96
97
98

set(svgthumbnail_PART_SRCS svgcreator.cpp)

add_library(svgthumbnail MODULE ${svgthumbnail_PART_SRCS})

target_link_libraries(svgthumbnail
	Qt5::Gui
	Qt5::Svg
	KF5::KIOCore
	KF5::KIOWidgets
)

99
install(TARGETS svgthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
100

101
102
103
104
105
106
107
108
109
########### next target ###############

set(textthumbnail_PART_SRCS textcreator.cpp)

add_library(textthumbnail MODULE ${textthumbnail_PART_SRCS})

target_link_libraries(textthumbnail
    Qt5::Gui
    KF5::KIOWidgets
110
    KF5::SyntaxHighlighting
111
112
)

113
install(TARGETS textthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
114

115
116
117
118
119
########### next target ###############

if(NOT WIN32)
set(djvuthumbnail_PART_SRCS djvucreator.cpp)

120
121
122
123
124
ecm_qt_declare_logging_category(djvuthumbnail_PART_SRCS
                                HEADER thumbnail-djvu-logsettings.h
                                IDENTIFIER KIO_THUMBNAIL_DJVU_LOG
                                CATEGORY_NAME log_kio_thumbnail.djvu)

125
126
127
128
add_library(djvuthumbnail MODULE ${djvuthumbnail_PART_SRCS})

target_link_libraries(djvuthumbnail KF5::KIOWidgets)

129
130
install(TARGETS djvuthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES djvuthumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
131
132

endif()
133
134
135
136
137
138

########### next target ###############

if(OpenEXR_FOUND)

    set(exrthumbnail_PART_SRCS exrcreator.cpp)
139
140
141
142
    ecm_qt_declare_logging_category(exrthumbnail_PART_SRCS
                                    HEADER thumbnail-exr-logsettings.h
                                    IDENTIFIER KIO_THUMBNAIL_EXR_LOG
                                    CATEGORY_NAME log_kio_thumbnail.exr)
143
144
145
146
147

    add_library(exrthumbnail MODULE ${exrthumbnail_PART_SRCS})
    target_link_libraries(exrthumbnail
            KF5::KIOCore
            KF5::KIOWidgets
148
    )
149
150
151
152
153
154
    if(TARGET OpenEXR::OpenEXR)
        target_link_libraries(exrthumbnail OpenEXR::OpenEXR)
    else()
        target_include_directories(exrthumbnail SYSTEM PRIVATE ${OpenEXR_INCLUDE_DIRS})
        target_link_libraries(exrthumbnail ${OpenEXR_LIBRARIES})
    endif()
155
156
157
158
159

    # OpenEXR headers use exceptions; at least clang refuses to build the target
    # when exceptions are not enabled.
    kde_source_files_enable_exceptions(exrcreator.cpp)

160
161
    install(TARGETS exrthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
    install( FILES exrthumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
162
163
164
165
166

endif()

########### next target ###############

Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
if(X11_Xcursor_FOUND)

    set(cursorthumbnail_PART_SRCS cursorcreator.cpp)

    add_library(cursorthumbnail MODULE ${cursorthumbnail_PART_SRCS})

    target_link_libraries(cursorthumbnail
        KF5::KIOCore
        KF5::KIOWidgets
        ${X11_Xcursor_LIB}
    )

    install(TARGETS cursorthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
    install( FILES cursorthumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})

endif()
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198

########### next target ###############

set ( windowsexethumbnail_SRCS windowsexecreator.cpp icoutils_common.cpp)
set ( windowsimagethumbnail_SRCS windowsimagecreator.cpp icoutils_common.cpp)

if(WIN32)
    set ( windowsexethumbnail_SRCS ${windowsexethumbnail_SRCS} icoutils_win.cpp )
    set ( windowsimagethumbnail_SRCS ${windowsimagethumbnail_SRCS} icoutils_win.cpp )
else()
    set ( windowsexethumbnail_SRCS ${windowsexethumbnail_SRCS} icoutils_wrestool.cpp )
    set ( windowsimagethumbnail_SRCS ${windowsimagethumbnail_SRCS} icoutils_wrestool.cpp )
endif()

add_library(windowsexethumbnail MODULE ${windowsexethumbnail_SRCS} )
target_link_libraries ( windowsexethumbnail KF5::KIOWidgets )
199
200
install ( TARGETS windowsexethumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install ( FILES windowsexethumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
201
202
203

add_library(windowsimagethumbnail MODULE ${windowsimagethumbnail_SRCS} )
target_link_libraries ( windowsimagethumbnail KF5::KIOWidgets )
204
205
install ( TARGETS windowsimagethumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR} )
install ( FILES windowsimagethumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR} )
206
207

########### next target ###############
208
209

set(comicbookthumbnail_SRCS comiccreator.cpp)
210
211
212
213
214
ecm_qt_declare_logging_category(comicbookthumbnail_SRCS
                                HEADER thumbnail-comic-logsettings.h
                                IDENTIFIER KIO_THUMBNAIL_COMIC_LOG
                                CATEGORY_NAME log_kio_thumbnail.comic)

215
216
217
218
219
220
add_library(comicbookthumbnail MODULE ${comicbookthumbnail_SRCS})
target_link_libraries(comicbookthumbnail
    Qt5::Gui
    KF5::Archive
    KF5::KIOWidgets
)
221
install(TARGETS comicbookthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
222

Halla Rempt's avatar
Halla Rempt committed
223
224
225
226
227
228
229
230
231
232
# ########### next target ###############

set(kritathumbnail_SRCS kritacreator.cpp)
add_library(kritathumbnail MODULE ${kritathumbnail_SRCS})

target_link_libraries(kritathumbnail
    KF5::KIOWidgets
    KF5::Archive
)

233
install(TARGETS kritathumbnail  DESTINATION ${KDE_INSTALL_PLUGINDIR})
Halla Rempt's avatar
Halla Rempt committed
234

Anthony Fieroni's avatar
Anthony Fieroni committed
235
236
237
238
########### next target #################

find_package(Taglib 1.11)

Harald Sitter's avatar
Harald Sitter committed
239
240
241
if(Taglib_FOUND)
    add_library(audiothumbnail MODULE audiocreator.cpp)
    target_link_libraries(audiothumbnail Taglib::Taglib KF5::KIOWidgets)
242
    install(TARGETS audiothumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
Anthony Fieroni's avatar
Anthony Fieroni committed
243
    set(audiothumbnail_desktop audiothumbnail.desktop)
Harald Sitter's avatar
Harald Sitter committed
244
endif()
Anthony Fieroni's avatar
Anthony Fieroni committed
245

Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
246
247
# ########### next target ###############

248
249
250
251
252
253
254
255
256
set(opendocumentthumbnail_SRCS opendocumentcreator.cpp)
add_library(opendocumentthumbnail MODULE ${opendocumentthumbnail_SRCS})

target_link_libraries(opendocumentthumbnail
    Qt5::Gui
    KF5::KIOWidgets
    KF5::Archive
)

257
install(TARGETS opendocumentthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
258
259
260

# ########### next target ###############

Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
261
if(libappimage_FOUND)
Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
262
263
264
265
266
267

set(appimagethumbnail_SRCS appimagecreator.cpp)
add_library(appimagethumbnail MODULE ${appimagethumbnail_SRCS})
target_link_libraries(appimagethumbnail
    KF5::KIOWidgets
    Qt5::Gui
268
    libappimage
Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
269
270
)

271
272
install(TARGETS appimagethumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})
install(FILES appimagethumbnail.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
273
274
275

endif()

Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
276
277
278
279
280
281
282
283
284
285
286
287
288
# ########### next target ###############

set(ebookthumbnail_SRCS ebookcreator.cpp)
add_library(ebookthumbnail MODULE ${ebookthumbnail_SRCS})

target_link_libraries(ebookthumbnail
    Qt5::Gui
    KF5::KIOWidgets
    KF5::Archive
)

install(TARGETS ebookthumbnail DESTINATION ${KDE_INSTALL_PLUGINDIR})

289
290
########### install files ###############

291
install(FILES thumbcreator.desktop DESTINATION ${KDE_INSTALL_KSERVICETYPES5DIR})
292
install(FILES
293
    svgthumbnail.desktop
294
    imagethumbnail.desktop
295
    jpegthumbnail.desktop
296
    textthumbnail.desktop
297
#    desktopthumbnail.desktop
298
    comicbookthumbnail.desktop
Halla Rempt's avatar
Halla Rempt committed
299
    kraorathumbnail.desktop
300
    opendocumentthumbnail.desktop
Kai Uwe Broulik's avatar
Kai Uwe Broulik committed
301
    ebookthumbnail.desktop
Anthony Fieroni's avatar
Anthony Fieroni committed
302
    ${audiothumbnail_desktop}
303
    DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
Laurent Montel's avatar
Laurent Montel committed
304