Commit 93918b1e authored by Frederik Gladhorn's avatar Frederik Gladhorn
Browse files

Basic cmake kf5 porting

parent 9186a4e8
project(okular)
find_package(KDE4 4.6.0 REQUIRED)
include(KDE4Defaults)
include(MacroLibrary)
include(MacroOptionalAddSubdirectory)
cmake_minimum_required(VERSION 2.8.12 FATAL_ERROR)
set(QT_MIN_VERSION "5.2.0")
find_package(ECM 0.0.14 REQUIRED NO_MODULE)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
include(KDEInstallDirs)
include(KDECMakeSettings)
include(KDECompilerSettings)
include(ECMInstallIcons)
include(ECMSetupVersion)
include(ECMOptionalAddSubdirectory)
find_package(Qt5 CONFIG REQUIRED COMPONENTS Core DBus Test Widgets)
find_package(KF5 REQUIRED Archive Bookmarks CoreAddons Config ConfigWidgets DBusAddons KIO KDELibs4Support Parts Activities)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)
macro_optional_find_package(QImageBlitz)
macro_log_feature(QIMAGEBLITZ_FOUND "QImageBlitz" "An image effects library" "http://sourceforge.net/projects/qimageblitz" TRUE "kdesupport" "Required to build Okular.")
find_package(QImageBlitz)
set_package_properties("QImageBlitz" PROPERTIES
DESCRIPTION "An image effects library"
URL "http://sourceforge.net/projects/qimageblitz"
TYPE RECOMMENDED
PURPOSE "Required to build Okular.")
macro_optional_find_package(LibKScreen)
macro_log_feature(LibKScreen_FOUND "LibKScreen" "KDE screen management library" "https://projects.kde.org/projects/kdereview/libkscreen" FALSE "1.0.2" "DPI detection support")
find_package(LibKScreen "1.0.2")
set_package_properties("LibKScreen" PROPERTIES
DESCRIPTION "KDE screen management library"
URL "https://projects.kde.org/projects/kdereview/libkscreen"
TYPE RECOMMENDED
PURPOSE "DPI detection support")
add_definitions(${QT_DEFINITIONS} ${KDE4_DEFINITIONS})
add_definitions(-DQT_USE_FAST_CONCATENATION -DQT_USE_FAST_OPERATOR_PLUS)
......@@ -27,10 +49,11 @@ add_subdirectory( ui )
add_subdirectory( shell )
add_subdirectory( generators )
add_subdirectory( tests )
macro_optional_add_subdirectory(doc)
message("TODO: doc build")
# FIXME ecm_optional_add_subdirectory(doc)
include(OkularConfigureChecks.cmake)
include(MacroWriteBasicCMakeVersionFile)
if(NOT WIN32)
set(MATH_LIB m)
......@@ -229,11 +252,12 @@ install( FILES part.rc part-viewermode.rc DESTINATION ${DATA_INSTALL_DIR}/okular
########### cmake files #################
macro_write_basic_cmake_version_file(${CMAKE_CURRENT_BINARY_DIR}/OkularConfigVersion.cmake 0 11 80)
include(WriteBasicConfigVersionFile)
write_basic_config_version_file(${CMAKE_CURRENT_BINARY_DIR}/OkularConfigVersion.cmake VERSION 0.11.80 COMPATIBILITY AnyNewerVersion)
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/OkularConfig.cmake
${CMAKE_CURRENT_BINARY_DIR}/OkularConfigVersion.cmake
DESTINATION ${LIB_INSTALL_DIR}/cmake/Okular )
macro_display_feature_log()
feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES)
macro_optional_find_package(ActiveApp)
macro_log_feature(ACTIVEAPP_FOUND "ActiveApp" "Support for developing applications for Plasma Active" "https://projects.kde.org/projects/extragear/base/plasma-mobile" FALSE "0.1")
find_package(ActiveApp "0.1")
set_package_properties("ActiveApp" PROPERTIES
DESCRIPTION "Support for developing applications for Plasma Active"
URL "https://projects.kde.org/projects/extragear/base/plasma-mobile"
TYPE OPTIONAL)
if (ACTIVEAPP_FOUND)
add_subdirectory( app )
......
include (MacroLogFeature)
set(LIBSPECTRE_MINIMUM_VERSION "0.2")
macro_optional_find_package(Poppler)
macro_log_feature(HAVE_POPPLER_0_12_1 "Poppler-Qt4" "A PDF rendering library" "http://poppler.freedesktop.org" FALSE "0.12.1" "Support for PDF files in okular.")
macro_optional_find_package(LibSpectre)
macro_log_feature(LIBSPECTRE_FOUND "libspectre" "A PostScript rendering library" "http://libspectre.freedesktop.org/wiki/" FALSE "${LIBSPECTRE_MINIMUM_VERSION}" "Support for PS files in okular.")
macro_optional_find_package(Kexiv2)
macro_log_feature(KEXIV2_FOUND "LibKExiv2" "Wrapper around Exiv2 library" "http://www.digikam.org/sharedlibs" FALSE "" "Support for image files")
macro_optional_find_package(CHM)
macro_log_feature(CHM_FOUND "CHM" "A library for dealing with Microsoft ITSS/CHM format files" "http://www.jedrea.com/chmlib" FALSE "" "Support CHM files in okular.")
macro_optional_find_package(DjVuLibre)
macro_log_feature(DJVULIBRE_FOUND "DjVuLibre" "A library for dealing with DjVu formatted files" "http://djvulibre.djvuzone.org" FALSE "3.5.17" "Support for DjVu files in okular.")
macro_optional_find_package(TIFF)
macro_log_feature(TIFF_FOUND "libTIFF" "A library for reading and writing TIFF formatted files," "http://www.remotesensing.org/libtiff" FALSE "" "Support for TIFF files in okular.")
macro_optional_find_package(Freetype)
macro_log_feature(FREETYPE_FOUND "FreeType" "A font rendering engine" "http://www.freetype.org" FALSE "" "Provides freetype font support in the okular DVI generator.")
macro_optional_find_package(JPEG)
macro_log_feature(JPEG_FOUND "JPEG" "A library for reading and writing JPEG image files." "http://www.ijg.org" FALSE "" "Support fof PalmDB documents in okular.")
macro_optional_find_package(ZLIB)
macro_log_feature(ZLIB_FOUND "ZLib" "The Zlib compression library" "http://www.zlib.net" FALSE "" "Support for Plucker files in Okular.")
macro_optional_find_package(EPub)
macro_log_feature(EPUB_FOUND "libepub" "A library for reading EPub documents" "http://sourceforge.net/projects/ebook-tools" FALSE "" "Support for EPub documents in Okular.")
macro_optional_find_package(QMobipocket)
macro_log_feature(QMOBIPOCKET_FOUND "libqmobipocket" "A library for reading Mobipocket documents" "https://projects.kde.org/projects/kde/kdegraphics/kdegraphics-mobipocket" FALSE "" "Support for Mobipocket documents in Okular.")
find_package(Poppler "0.12.1")
set_package_properties("Poppler-Qt4" PROPERTIES
DESCRIPTION "A PDF rendering library"
URL "http://poppler.freedesktop.org"
TYPE RECOMMENDED
PURPOSE "Support for PDF files in okular.")
find_package(LibSpectre "${LIBSPECTRE_MINIMUM_VERSION}")
set_package_properties("libspectre" PROPERTIES
DESCRIPTION "A PostScript rendering library"
URL "http://libspectre.freedesktop.org/wiki/"
TYPE RECOMMENDED
PURPOSE "Support for PS files in okular.")
find_package(Kexiv2)
set_package_properties("LibKExiv2" PROPERTIES
DESCRIPTION "Wrapper around Exiv2 library"
URL "http://www.digikam.org/sharedlibs"
TYPE RECOMMENDED
PURPOSE "Support for image files")
find_package(CHM)
set_package_properties("CHM" PROPERTIES
DESCRIPTION "A library for dealing with Microsoft ITSS/CHM format files"
URL "http://www.jedrea.com/chmlib"
TYPE RECOMMENDED
PURPOSE "Support CHM files in okular.")
find_package(DjVuLibre "3.5.17")
set_package_properties("DjVuLibre" PROPERTIES
DESCRIPTION "A library for dealing with DjVu formatted files"
URL "http://djvulibre.djvuzone.org"
TYPE RECOMMENDED
PURPOSE "Support for DjVu files in okular.")
find_package(TIFF)
set_package_properties("libTIFF" PROPERTIES
DESCRIPTION "A library for reading and writing TIFF formatted files,"
URL "http://www.remotesensing.org/libtiff"
TYPE RECOMMENDED
PURPOSE "Support for TIFF files in okular.")
find_package(Freetype)
set_package_properties("FreeType" PROPERTIES
DESCRIPTION "A font rendering engine"
URL "http://www.freetype.org"
TYPE RECOMMENDED
PURPOSE "Provides freetype font support in the okular DVI generator.")
find_package(JPEG)
set_package_properties("JPEG" PROPERTIES
DESCRIPTION "A library for reading and writing JPEG image files."
URL "http://www.ijg.org"
TYPE RECOMMENDED
PURPOSE "Support fof PalmDB documents in okular.")
find_package(ZLIB)
set_package_properties("ZLib" PROPERTIES
DESCRIPTION "The Zlib compression library"
URL "http://www.zlib.net"
TYPE RECOMMENDED
PURPOSE "Support for Plucker files in Okular.")
find_package(EPub)
set_package_properties("libepub" PROPERTIES
DESCRIPTION "A library for reading EPub documents"
URL "http://sourceforge.net/projects/ebook-tools"
TYPE RECOMMENDED
PURPOSE "Support for EPub documents in Okular.")
find_package(QMobipocket)
set_package_properties("libqmobipocket" PROPERTIES
DESCRIPTION "A library for reading Mobipocket documents"
URL "https://projects.kde.org/projects/kde/kdegraphics/kdegraphics-mobipocket"
TYPE RECOMMENDED
PURPOSE "Support for Mobipocket documents in Okular.")
# let's enable the generators properly configured
......
......@@ -3,8 +3,13 @@ include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/../..
)
macro_optional_find_package(QCA2)
macro_log_feature(QCA2_FOUND "QCA" "Qt Cryptographic Architecture (QCA)" "http://delta.affinix.com/qca/" FALSE "2.0.0" "Support for encrypted OpenDocument Text documents in Okular.")
find_package(QCA2 "2.0.0")
set_package_properties("QCA" PROPERTIES
DESCRIPTION "Qt Cryptographic Architecture (QCA)"
URL "http://www.digikam.org/sharedlibs"
TYPE RECOMMENDED
PURPOSE "Support for encrypted OpenDocument Text documents in Okular.")
if ( QCA2_FOUND )
include_directories( ${QCA2_INCLUDE_DIR} )
......
......@@ -4,9 +4,12 @@ include_directories(
)
# checking whether we should enable activities support
macro_optional_find_package(KActivities 6.1.0)
macro_log_feature(KActivities_FOUND "KActivities" "Activities interface library" "https://projects.kde.org/projects/kde/kdelibs/kactivities" FALSE "6.1.0" "Required for Activities integration.")
find_package(KActivities "6.1.0")
set_package_properties("KActivities" PROPERTIES
DESCRIPTION "Activities interface library"
URL "https://projects.kde.org/projects/kde/kdelibs/kactivities"
TYPE RECOMMENDED
PURPOSE "Required for Activities integration.")
if(KActivities_FOUND)
add_definitions(-DKActivities_FOUND)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment