Warning, /graphics/okular/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 cmake_minimum_required(VERSION 3.22)
0002 
0003 # KDE Application Version, managed by release script
0004 set (RELEASE_SERVICE_VERSION_MAJOR "24")
0005 set (RELEASE_SERVICE_VERSION_MINOR "04")
0006 set (RELEASE_SERVICE_VERSION_MICRO "70")
0007 set (RELEASE_SERVICE_VERSION "${RELEASE_SERVICE_VERSION_MAJOR}.${RELEASE_SERVICE_VERSION_MINOR}.${RELEASE_SERVICE_VERSION_MICRO}")
0008 
0009 project(okular VERSION ${RELEASE_SERVICE_VERSION})
0010 
0011 set(QT_REQUIRED_VERSION "6.6.0") # Remember to update the QT_DEPRECATED_WARNINGS_SINCE below
0012 set(KF_REQUIRED_VERSION "5.240.0") # Remember to update the KF_DEPRECATED_WARNINGS_SINCE below
0013 
0014 set(OKULAR_UI "" CACHE STRING "Which Okular user interface to build. Possible values: desktop, mobile, both. Default: desktop (except on Android, where it is 'mobile')")
0015 
0016 set(FORCE_NOT_REQUIRED_DEPENDENCIES "" CACHE STRING "List (semicolon-separated) of dependencies that will be downgraded from REQUIRED to RECOMMENDED")
0017 
0018 find_package(ECM ${KF_REQUIRED_VERSION} CONFIG REQUIRED)
0019 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
0020 
0021 include(ECMInstallIcons)
0022 include(ECMSetupVersion)
0023 include(ECMOptionalAddSubdirectory)
0024 include(GenerateExportHeader)
0025 include(FeatureSummary)
0026 include(ECMAddAppIcon)
0027 include(KDECompilerSettings NO_POLICY_SCOPE)
0028 include(KDEInstallDirs)
0029 include(KDECMakeSettings)
0030 include(ECMAddTests)
0031 include(ECMAddAppIcon)
0032 include(CMakePackageConfigHelpers)
0033 include(ECMSetupQtPluginMacroNames)
0034 
0035 if (ANDROID AND (FORCE_NOT_REQUIRED_DEPENDENCIES STREQUAL ""))
0036     set(FORCE_NOT_REQUIRED_DEPENDENCIES "KF6Wallet;KF6DocTools;Qt6Qml;TIFF;LibSpectre;KExiv2Qt6;CHM;LibZip;DjVuLibre;EPub;Discount;")
0037 endif()
0038 
0039 function(set_okular_optional_package_properties _name _props)
0040     if(NOT "${_props}" STREQUAL "PROPERTIES")
0041         message(FATAL_ERROR "PROPERTIES keyword is missing in set_okular_optional_package_properties() call.")
0042     endif()
0043 
0044     set(options) # none
0045     set(oneValueArgs DESCRIPTION URL PURPOSE)
0046     set(multiValueArgs) # none
0047 
0048     CMAKE_PARSE_ARGUMENTS(_SPP "${options}" "${oneValueArgs}" "${multiValueArgs}"  ${ARGN})
0049 
0050     if(_SPP_UNPARSED_ARGUMENTS)
0051         message(FATAL_ERROR "Unknown keywords given to set_okular_optional_package_properties(): \"${_SPP_UNPARSED_ARGUMENTS}\"")
0052     endif()
0053 
0054     set(DEPENDENCY_TYPE "REQUIRED")
0055     if (${_name} IN_LIST FORCE_NOT_REQUIRED_DEPENDENCIES)
0056         set(DEPENDENCY_TYPE "RECOMMENDED")
0057     endif()
0058     set_package_properties(${_name} PROPERTIES
0059         TYPE ${DEPENDENCY_TYPE}
0060         DESCRIPTION ${_SPP_DESCRIPTION}
0061         URL ${_SPP_URL}
0062         PURPOSE "${_SPP_PURPOSE} You can make the dependency optional adding ${_name} to the FORCE_NOT_REQUIRED_DEPENDENCIES cmake option"
0063     )
0064 endfunction()
0065 
0066 if(OKULAR_UI STREQUAL "")
0067     if(ANDROID)
0068         set(OKULAR_UI "mobile")
0069     else()
0070         set(OKULAR_UI "desktop")
0071     endif()
0072 endif()
0073 
0074 if(OKULAR_UI STREQUAL "desktop" OR OKULAR_UI STREQUAL "both")
0075     set(BUILD_DESKTOP ON)
0076 else()
0077     set(BUILD_DESKTOP OFF)
0078 endif()
0079 if(OKULAR_UI STREQUAL "mobile" OR OKULAR_UI STREQUAL "both")
0080     set(BUILD_MOBILE ON)
0081 else()
0082     set(BUILD_MOBILE OFF)
0083 endif()
0084 
0085 # append the plugins from the install tree folder to the QT_PLUGIN_PATH
0086 if(UNIX)
0087     set(ENV{QT_PLUGIN_PATH} "$ENV{QT_PLUGIN_PATH}:${KDE_INSTALL_FULL_QTPLUGINDIR}")
0088 elseif(WIN32)
0089     set(ENV{QT_PLUGIN_PATH} "$ENV{QT_PLUGIN_PATH};${KDE_INSTALL_FULL_QTPLUGINDIR}")
0090 endif()
0091 
0092 set(CMAKE_CXX_STANDARD 17)
0093 set(CMAKE_CXX_STANDARD_REQUIRED ON)
0094 set(CMAKE_CXX_EXTENSIONS OFF)
0095 
0096 ecm_setup_version(${PROJECT_VERSION}
0097                   VARIABLE_PREFIX OKULAR
0098                   VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/core/version.h"
0099                   PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/Okular6ConfigVersion.cmake")
0100 
0101 find_package(Qt6 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core Test Widgets PrintSupport Svg Xml)
0102 
0103 ecm_setup_qtplugin_macro_names(
0104     JSON_ARG2
0105         "OKULAR_EXPORT_PLUGIN"
0106     CONFIG_CODE_VARIABLE
0107         PACKAGE_SETUP_AUTOMOC_VARIABLES
0108 )
0109 
0110 find_package(KF6 ${KF_REQUIRED_VERSION} REQUIRED COMPONENTS
0111     Archive
0112     Bookmarks
0113     Completion
0114     Config
0115     ConfigWidgets
0116     CoreAddons
0117     I18n
0118     KIO
0119     ThreadWeaver
0120     WindowSystem
0121     XmlGui
0122 )
0123 
0124 if (NOT WIN32)
0125     find_package(KF6Wallet ${KF_REQUIRED_VERSION})
0126     set_okular_optional_package_properties(KF6Wallet PROPERTIES
0127     PURPOSE "Required for document storing passwords in secure wallets.")
0128 endif()
0129 if(KF6Wallet_FOUND)
0130     set(HAVE_KWALLET 1)
0131 else()
0132     set(HAVE_KWALLET 0)
0133 endif()
0134 
0135 find_package(KF6DocTools ${KF_REQUIRED_VERSION})
0136 set_okular_optional_package_properties(KF6DocTools PROPERTIES
0137     PURPOSE "Required for compiling and installing the user documentation.")
0138 
0139 find_package(Qt6Qml)
0140 set_okular_optional_package_properties(Qt6Qml PROPERTIES
0141     PURPOSE "Required for supporting JavaScript in PDF documents")
0142 if(TARGET Qt6::Qml)
0143     set(HAVE_JS 1)
0144 else()
0145     set(HAVE_JS 0)
0146 endif()
0147 
0148 if (BUILD_DESKTOP)
0149     find_package(Qt6DBus)
0150     set_okular_optional_package_properties(Qt6DBus PROPERTIES
0151         PURPOSE "Required for interprocess communication, external open in same instance and various presentation related bits.")
0152     if(TARGET Qt6::DBus)
0153         set(HAVE_DBUS 1)
0154     else()
0155         set(HAVE_DBUS 0)
0156     endif()
0157     find_package(KF6 ${KF_REQUIRED_VERSION} REQUIRED COMPONENTS Parts Crash IconThemes TextWidgets)
0158 
0159     find_package(KF6Purpose)
0160     set_okular_optional_package_properties(KF6Purpose PROPERTIES
0161         DESCRIPTION "A framework for services and actions integration"
0162         PURPOSE "Required for enabling the share menu.")
0163     if (KF6Purpose_FOUND)
0164         set(HAVE_PURPOSE 1)
0165     else()
0166         set(HAVE_PURPOSE 0)
0167     endif()
0168 
0169     find_package(Qt6TextToSpeech ${QT_REQUIRED_VERSION} CONFIG)
0170     set_okular_optional_package_properties(Qt6TextToSpeech PROPERTIES
0171         PURPOSE "Enables speech features.")
0172     if (Qt6TextToSpeech_FOUND)
0173         set(HAVE_SPEECH 1)
0174     else()
0175         set(HAVE_SPEECH 0)
0176     endif()
0177 endif()
0178 
0179 if (BUILD_MOBILE)
0180     find_package(Qt6 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Qml Quick)
0181     find_package(KF6Kirigami2)
0182     set_package_properties(KF6Kirigami2 PROPERTIES
0183         DESCRIPTION "A QtQuick based components set"
0184         PURPOSE "Required at runtime by the mobile app"
0185         TYPE RUNTIME
0186     )
0187     find_package(KF6KirigamiAddons)
0188     set_package_properties(KF6KirigamiAddons PROPERTIES
0189         DESCRIPTION "A set of widgets for Kirigami along with  code to support them"
0190         PURPOSE "Required at runtime by the mobile app"
0191         TYPE RUNTIME
0192     )
0193 endif()
0194 
0195 if(NOT WIN32 AND NOT ANDROID AND NOT APPLE)
0196     find_package(Qt6Gui REQUIRED COMPONENTS Private)
0197     find_package(PlasmaActivities REQUIRED)
0198     set_package_properties("PlasmaActivities" PROPERTIES
0199         DESCRIPTION  "Activities interface library"
0200         URL "https://invent.kde.org/plasma/plasma-activities"
0201         PURPOSE "Required for Activities integration."
0202     )
0203     set(HAVE_X11 TRUE)
0204 else()
0205     set(HAVE_X11 FALSE)
0206 endif()
0207 find_package(Phonon4Qt6 CONFIG)
0208 set_okular_optional_package_properties(Phonon4Qt6 PROPERTIES
0209     PURPOSE "Required for documents with audio or video elements")
0210 if (Phonon4Qt6_FOUND)
0211     set(HAVE_PHONON 1)
0212 else()
0213     set(HAVE_PHONON 0)
0214 endif()
0215 
0216 set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)
0217 
0218 find_package(ZLIB REQUIRED)
0219 
0220 find_package(Poppler "22.02.0" COMPONENTS Qt6)
0221 set_okular_optional_package_properties(Poppler PROPERTIES
0222         PURPOSE "Support for PDF files in okular.")
0223 
0224 find_package(Freetype)
0225 set_okular_optional_package_properties(Freetype PROPERTIES
0226         DESCRIPTION  "A font rendering engine"
0227         URL "https://www.freetype.org"
0228         PURPOSE "Provides freetype font support in the okular DVI generator.")
0229 
0230 find_package(TIFF)
0231 set_okular_optional_package_properties(TIFF PROPERTIES
0232         DESCRIPTION  "A library for reading and writing TIFF formatted files,"
0233         URL "http://www.libtiff.org"
0234         PURPOSE "Support for TIFF files in okular.")
0235 
0236 set(LIBSPECTRE_MINIMUM_VERSION "0.2")
0237 find_package(LibSpectre "${LIBSPECTRE_MINIMUM_VERSION}")
0238 set_okular_optional_package_properties(LibSpectre PROPERTIES
0239         DESCRIPTION  "A PostScript rendering library"
0240         URL "https://libspectre.freedesktop.org"
0241         PURPOSE "Support for PS files in okular.")
0242 
0243 find_package(KExiv2Qt6 CONFIG)
0244 set_okular_optional_package_properties(KExiv2Qt6 PROPERTIES
0245         DESCRIPTION  "Wrapper around Exiv2 library"
0246         URL "https://commits.kde.org/libkexiv2"
0247         PURPOSE "Support for exif rotation in image files.")
0248 
0249 if (FALSE ) # Investigate porting at some point
0250     find_package(CHM)
0251     set_okular_optional_package_properties(CHM PROPERTIES
0252             DESCRIPTION  "A library for dealing with Microsoft ITSS/CHM format files"
0253             URL "http://www.jedrea.com/chmlib"
0254             PURPOSE "Support CHM files in okular.")
0255 
0256 endif()
0257 
0258 find_package(LibZip)
0259 set_okular_optional_package_properties(LibZip PROPERTIES
0260         DESCRIPTION  "A library for reading, creating, and modifying zip archives"
0261         URL "https://libzip.org/"
0262         PURPOSE "Support CHM files in okular.")
0263 
0264 find_package(DjVuLibre "3.5.28")
0265 set_okular_optional_package_properties(DjVuLibre PROPERTIES
0266         DESCRIPTION  "A library for dealing with DjVu formatted files"
0267         URL "https://djvulibre.djvuzone.org"
0268         PURPOSE "Support for DjVu files in okular.")
0269 
0270 find_package(EPub)
0271 set_okular_optional_package_properties(EPub PROPERTIES
0272         DESCRIPTION  "A library for reading EPub documents"
0273         URL "http://sourceforge.net/projects/ebook-tools"
0274         PURPOSE "Support for EPub documents in Okular.")
0275 
0276 find_package(QMobipocket6 "2" CONFIG)
0277 set_okular_optional_package_properties(QMobiPocket6 PROPERTIES
0278         DESCRIPTION  "A library for reading Mobipocket documents"
0279         URL "https://commits.kde.org/kdegraphics-mobipocket"
0280         PURPOSE "Support for Mobipocket documents in Okular.")
0281 
0282 find_package(Discount)
0283 set_okular_optional_package_properties(Discount PROPERTIES
0284         DESCRIPTION "A library that gives you formatting functions suitable for marking down entire documents or lines of text"
0285         URL "https://www.pell.portland.or.us/~orc/Code/discount/"
0286         PURPOSE "Support for Markdown documents in Okular.")
0287 
0288 add_definitions(-DTRANSLATION_DOMAIN="okular")
0289 add_definitions(-DQT_DEPRECATED_WARNINGS_SINCE=0x060600)
0290 add_definitions(-DKF_DEPRECATED_WARNINGS_SINCE=0x05F000)
0291 
0292 include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${PHONON_INCLUDES} core/synctex ${CMAKE_BINARY_DIR}/core)
0293 
0294 option(BUILD_COVERAGE "Build the project with gcov support" OFF)
0295 
0296 if(BUILD_COVERAGE)
0297     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fprofile-arcs -ftest-coverage")
0298     set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
0299 endif()
0300 
0301 add_subdirectory( icons ) # an own directory for multi-size icons retrieved by KIconThemeLoader
0302 add_subdirectory( part )
0303 if(BUILD_DESKTOP)
0304     add_subdirectory( shell )
0305 endif()
0306 add_subdirectory( generators )
0307 
0308 if(BUILD_MOBILE)
0309     add_subdirectory( mobile )
0310 endif()
0311 
0312 if(BUILD_TESTING)
0313    add_subdirectory( autotests )
0314 endif()
0315 
0316 if(KF6DocTools_FOUND)
0317     add_subdirectory(doc)
0318 endif()
0319 
0320 include(OkularConfigureChecks.cmake)
0321 
0322 if(NOT WIN32)
0323  set(MATH_LIB m)
0324 else(NOT WIN32)
0325  set(MATH_LIB)
0326 endif(NOT WIN32)
0327 
0328 # okularcore
0329 
0330 set(okularcore_SRCS
0331    core/action.cpp
0332    core/annotations.cpp
0333    core/area.cpp
0334    core/audioplayer.cpp
0335    core/bookmarkmanager.cpp
0336    core/chooseenginedialog.cpp
0337    core/document.cpp
0338    core/documentcommands.cpp
0339    core/fontinfo.cpp
0340    core/form.cpp
0341    core/generator.cpp
0342    core/generator_p.cpp
0343    core/misc.cpp
0344    core/movie.cpp
0345    core/observer.cpp
0346    core/debug.cpp
0347    core/page.cpp
0348    core/pagecontroller.cpp
0349    core/pagesize.cpp
0350    core/pagetransition.cpp
0351    core/rotationjob.cpp
0352    core/scripter.cpp
0353    core/sound.cpp
0354    core/sourcereference.cpp
0355    core/textdocumentgenerator.cpp
0356    core/textdocumentsettings.cpp
0357    core/textpage.cpp
0358    core/tilesmanager.cpp
0359    core/utils.cpp
0360    core/view.cpp
0361    core/fileprinter.cpp
0362    core/printoptionswidget.cpp
0363    core/signatureutils.cpp
0364    core/script/event.cpp
0365    core/synctex/synctex_parser.c
0366    core/synctex/synctex_parser_utils.c
0367 )
0368 qt_add_resources(okularcore_SRCS
0369    core/script/builtin.qrc
0370 )
0371 
0372 ki18n_wrap_ui(okularcore_SRCS
0373    part/textdocumentsettings.ui
0374 )
0375 
0376 install( FILES
0377            core/action.h
0378            core/annotations.h
0379            core/area.h
0380            core/document.h
0381            core/fontinfo.h
0382            core/form.h
0383            core/generator.h
0384            core/global.h
0385            core/page.h
0386            core/pagesize.h
0387            core/pagetransition.h
0388            core/signatureutils.h
0389            core/sound.h
0390            core/sourcereference.h
0391            core/textdocumentgenerator.h
0392            core/textdocumentsettings.h
0393            core/textpage.h
0394            core/tile.h
0395            core/utils.h
0396            core/fileprinter.h
0397            core/printoptionswidget.h
0398            core/observer.h
0399            ${CMAKE_CURRENT_BINARY_DIR}/core/version.h
0400            ${CMAKE_CURRENT_BINARY_DIR}/core/okularcore_export.h
0401            ${CMAKE_CURRENT_BINARY_DIR}/settings_core.h
0402          DESTINATION ${KDE_INSTALL_INCLUDEDIR}/okular/core COMPONENT Devel)
0403 
0404 install( FILES
0405            interfaces/configinterface.h
0406            interfaces/guiinterface.h
0407            interfaces/printinterface.h
0408            interfaces/saveinterface.h
0409            interfaces/viewerinterface.h
0410          DESTINATION ${KDE_INSTALL_INCLUDEDIR}/okular/interfaces COMPONENT Devel)
0411 
0412 ki18n_wrap_ui(okularcore_SRCS
0413    core/chooseenginewidget.ui
0414 )
0415 
0416 kconfig_add_kcfg_files(okularcore_SRCS GENERATE_MOC conf/settings_core.kcfgc)
0417 
0418 add_library(okularcore SHARED ${okularcore_SRCS})
0419 generate_export_header(okularcore BASE_NAME okularcore EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/core/okularcore_export.h")
0420 target_include_directories(okularcore PUBLIC "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR}>")
0421 
0422 if (ANDROID)
0423     set(fileName ${CMAKE_BINARY_DIR}/Okular5Core-android-dependencies.xml)
0424     file(WRITE "${fileName}" "<rules><dependencies><lib name='Okular5Core'><depends>\n"
0425                                 "<bundled file='${KDE_INSTALL_PLUGINDIR}/okular/generators' />\n"
0426                              "</depends></lib></dependencies></rules>\n")
0427     install(FILES ${fileName} DESTINATION ${KDE_INSTALL_LIBDIR})
0428 endif()
0429 
0430 
0431 # Special handling for linking okularcore on OSX/Apple
0432 IF(APPLE)
0433     SET(OKULAR_IOKIT "-framework IOKit" CACHE STRING "Apple IOKit framework")
0434 ENDIF(APPLE)
0435 
0436 # Extra library needed by imported synctex code on Windows
0437 if(WIN32)
0438     set(SHLWAPI shlwapi)
0439 endif(WIN32)
0440 
0441 target_link_libraries(okularcore
0442 PRIVATE
0443     ${OKULAR_IOKIT}
0444     ${SHLWAPI}
0445     KF6::Archive
0446     KF6::KIOCore
0447     KF6::KIOWidgets
0448     KF6::I18n
0449     KF6::ThreadWeaver
0450     KF6::BookmarksWidgets
0451     KF6::Bookmarks
0452     Qt6::Svg
0453     ${MATH_LIB}
0454     ZLIB::ZLIB
0455 PUBLIC  # these are included from the installed headers
0456     KF6::CoreAddons
0457     KF6::XmlGui
0458     KF6::ConfigGui
0459     Qt6::PrintSupport
0460     Qt6::Widgets
0461 )
0462 if (Phonon4Qt6_FOUND)
0463     target_link_libraries(okularcore PRIVATE Phonon::phonon4qt6)
0464 endif()
0465 
0466 
0467 if (KF6Wallet_FOUND)
0468     target_link_libraries(okularcore PRIVATE KF6::Wallet)
0469 endif()
0470 if (TARGET Qt6::Qml)
0471     target_sources(okularcore PRIVATE
0472             core/script/executor_js.cpp
0473             core/script/js_app.cpp
0474             core/script/js_console.cpp
0475             core/script/js_data.cpp
0476             core/script/js_display.cpp
0477             core/script/js_document.cpp
0478             core/script/js_field.cpp
0479             core/script/js_fullscreen.cpp
0480             core/script/js_field.cpp
0481             core/script/js_spell.cpp
0482             core/script/js_util.cpp
0483             core/script/js_event.cpp
0484             core/script/js_ocg.cpp
0485     )
0486     target_link_libraries(okularcore PRIVATE Qt6::Qml)
0487 endif()
0488 
0489 set_target_properties(okularcore PROPERTIES VERSION 1.0.0 SOVERSION 1 OUTPUT_NAME Okular6Core EXPORT_NAME Core)
0490 
0491 install(TARGETS okularcore EXPORT Okular6Targets ${KDE_INSTALL_TARGETS_DEFAULT_ARGS})
0492 
0493 install(FILES conf/okular.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
0494 install(FILES conf/okular_core.kcfg DESTINATION ${KDE_INSTALL_KCFGDIR})
0495 
0496 if(BUILD_DESKTOP)
0497   # okularpart
0498   set(okularpart_SRCS
0499     gui/certificatemodel.cpp
0500     gui/debug_ui.cpp
0501     gui/guiutils.cpp
0502     gui/pagepainter.cpp
0503     gui/signatureguiutils.cpp
0504     gui/signaturemodel.cpp
0505     gui/tocmodel.cpp
0506     part/preferencesdialog.cpp
0507     part/dlgaccessibility.cpp
0508     part/dlgdebug.cpp
0509     part/dlgeditor.cpp
0510     part/dlggeneral.cpp
0511     part/dlgannotations.cpp
0512     part/dlgperformance.cpp
0513     part/dlgpresentation.cpp
0514     part/editannottooldialog.cpp
0515     part/editdrawingtooldialog.cpp
0516     part/widgetannottools.cpp
0517     part/widgetconfigurationtoolsbase.cpp
0518     part/widgetdrawingtools.cpp
0519     part/part.cpp
0520     part/extensions.cpp
0521     part/embeddedfilesdialog.cpp
0522     part/actionbar.cpp
0523     part/annotationactionhandler.cpp
0524     part/annotwindow.cpp
0525     part/annotationmodel.cpp
0526     part/annotationpopup.cpp
0527     part/annotationpropertiesdialog.cpp
0528     part/annotationproxymodels.cpp
0529     part/annotationtools.cpp
0530     part/annotationwidgets.cpp
0531     part/bookmarklist.cpp
0532     part/certificateviewer.cpp
0533     part/colormodemenu.cpp
0534     part/cursorwraphelper.cpp
0535     part/drawingtoolactions.cpp
0536     part/fileprinterpreview.cpp
0537     part/findbar.cpp
0538     part/formwidgets.cpp
0539     part/ktreeviewsearchline.cpp
0540     part/latexrenderer.cpp
0541     part/minibar.cpp
0542     part/okmenutitle.cpp
0543     part/pageitemdelegate.cpp
0544     part/pagesizelabel.cpp
0545     part/pageviewannotator.cpp
0546     part/pageviewmouseannotation.cpp
0547     part/pageview.cpp
0548     part/magnifierview.cpp
0549     part/pageviewutils.cpp
0550     part/presentationsearchbar.cpp
0551     part/presentationwidget.cpp
0552     part/propertiesdialog.cpp
0553     part/revisionviewer.cpp
0554     part/searchlineedit.cpp
0555     part/searchwidget.cpp
0556     part/sidebar.cpp
0557     part/side_reviews.cpp
0558     part/snapshottaker.cpp
0559     part/thumbnaillist.cpp
0560     part/toc.cpp
0561     part/toggleactionmenu.cpp
0562     part/videowidget.cpp
0563     part/layers.cpp
0564     part/signaturepartutils.cpp
0565     part/signaturepropertiesdialog.cpp
0566     part/signaturepanel.cpp
0567 
0568     part/part.qrc
0569   )
0570   ki18n_wrap_ui(okularpart_SRCS part/selectcertificatedialog.ui)
0571 
0572 if (Qt6TextToSpeech_FOUND)
0573    set(okularpart_SRCS ${okularpart_SRCS}
0574       part/tts.cpp)
0575 endif()
0576 
0577 kconfig_add_kcfg_files(okularpart_SRCS GENERATE_MOC conf/settings.kcfgc)
0578 
0579 add_library(okularpart SHARED ${okularpart_SRCS})
0580 generate_export_header(okularpart BASE_NAME okularpart)
0581 
0582 target_link_libraries(okularpart okularcore
0583     ${MATH_LIB}
0584     Qt6::Svg
0585     KF6::Archive
0586     KF6::Bookmarks
0587     KF6::I18n
0588     KF6::IconThemes
0589     KF6::ItemViews
0590     KF6::KIOCore
0591     KF6::KIOWidgets
0592     KF6::Parts
0593     KF6::WindowSystem
0594     KF6::TextWidgets
0595 )
0596 if (TARGET Qt6::DBus)
0597     target_link_libraries(okularpart Qt6::DBus)
0598 endif()
0599 if (Phonon4Qt6_FOUND)
0600    target_link_libraries(okularpart Phonon::phonon4qt6)
0601 endif()
0602 
0603 if(KF6Wallet_FOUND)
0604     target_link_libraries(okularpart KF6::Wallet)
0605 endif()
0606 
0607 if (KF6Purpose_FOUND)
0608     target_link_libraries(okularpart KF6::PurposeWidgets)
0609 endif()
0610 
0611 set_target_properties(okularpart PROPERTIES PREFIX "")
0612 set_target_properties(okularpart PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/kf6/parts)
0613 
0614 if (Qt6TextToSpeech_FOUND)
0615    target_link_libraries(okularpart Qt6::TextToSpeech)
0616 endif()
0617 
0618 #instead install the part to this path so it can be found
0619 install(TARGETS okularpart DESTINATION ${KDE_INSTALL_PLUGINDIR}/kf6/parts/ )
0620 
0621 endif()# End of BUILD_DESKTOP if
0622 
0623 
0624 ########### install files ###############
0625 
0626 install(FILES okular.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
0627 install(FILES okular.categories  DESTINATION  ${KDE_INSTALL_LOGGINGCATEGORIESDIR})
0628 
0629 ki18n_install(po)
0630 if(KF6DocTools_FOUND)
0631     kdoctools_install(po)
0632 endif()
0633 
0634 ########### cmake files #################
0635 
0636 set(CMAKECONFIG_INSTALL_DIR "${KDE_INSTALL_CMAKEPACKAGEDIR}/Okular6")
0637 configure_package_config_file(
0638   "${CMAKE_CURRENT_SOURCE_DIR}/Okular6Config.cmake.in"
0639   "${CMAKE_CURRENT_BINARY_DIR}/Okular6Config.cmake"
0640   INSTALL_DESTINATION  ${CMAKECONFIG_INSTALL_DIR}
0641   PATH_VARS  KDE_INSTALL_INCLUDEDIR CMAKE_INSTALL_PREFIX
0642 )
0643 
0644 install(FILES
0645   "${CMAKE_CURRENT_BINARY_DIR}/Okular6Config.cmake"
0646   "${CMAKE_CURRENT_BINARY_DIR}/Okular6ConfigVersion.cmake"
0647   DESTINATION "${CMAKECONFIG_INSTALL_DIR}"
0648   COMPONENT Devel
0649 )
0650 
0651 install(EXPORT Okular6Targets DESTINATION "${CMAKECONFIG_INSTALL_DIR}" FILE Okular6Targets.cmake NAMESPACE Okular::)
0652 
0653 install(FILES
0654    core/stamps.svg
0655    DESTINATION ${KDE_INSTALL_DATADIR}/okular/pics)
0656 
0657 ########### summary #################
0658 
0659 feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
0660 
0661 message("-- Building Desktop User Interface: ${BUILD_DESKTOP}")
0662 message("-- Building Mobile Interface: ${BUILD_MOBILE}")
0663 message("")