@ -13,6 +13,39 @@ set(KF5_REQUIRED_VERSION "5.68.0") # Remember to update the KF_DEPRECATED_WARNIN
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')" )
option ( FORCE_NOT_REQUIRED_DEPENDENCIES "List (semicolon-separated) of dependencies that will be downgraded from REQUIRED to RECOMMENDED" )
if ( ANDROID AND ( NOT FORCE_NOT_REQUIRED_DEPENDENCIES ) AND ( NOT FORCE_NOT_REQUIRED_DEPENDENCIES STREQUAL "" ) )
set ( FORCE_NOT_REQUIRED_DEPENDENCIES "KF5Wallet;KF5DocTools;KF5JS;TIFF;JPEG;LibSpectre;KF5KExiv2;CHM;KF5KHtml;LibZip;DjVuLibre;EPub;Discount;" )
endif ( )
function ( set_okular_optional_package_properties _name _props )
if ( NOT "${_props}" STREQUAL "PROPERTIES" )
message ( FATAL_ERROR "PROPERTIES keyword is missing in set_okular_optional_package_properties() call." )
endif ( )
set ( options ) # n o n e
set ( oneValueArgs DESCRIPTION URL PURPOSE )
set ( multiValueArgs ) # n o n e
CMAKE_PARSE_ARGUMENTS ( _SPP "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ ARGN } )
if ( _SPP_UNPARSED_ARGUMENTS )
message ( FATAL_ERROR "Unknown keywords given to set_okular_optional_package_properties(): \" ${ _SPP_UNPARSED_ARGUMENTS } \"")
endif ( )
set ( DEPENDENCY_TYPE "REQUIRED" )
if ( ${ _name } IN_LIST FORCE_NOT_REQUIRED_DEPENDENCIES )
set ( DEPENDENCY_TYPE "RECOMMENDED" )
endif ( )
set_package_properties ( ${ _name } PROPERTIES
T Y P E $ { D E P E N D E N C Y _ T Y P E }
D E S C R I P T I O N $ { _ S P P _ D E S C R I P T I O N }
U R L $ { _ S P P _ U R L }
P U R P O S E " $ { _ S P P _ P U R P O S E } Y o u c a n m a k e t h e d e p e n d e n c y o p t i o n a l a d d i n g $ { _ n a m e } t o t h e F O R C E _ N O T _ R E Q U I R E D _ D E P E N D E N C I E S c m a k e o p t i o n "
)
endfunction ( )
if ( OKULAR_UI STREQUAL "" )
if ( ANDROID )
set ( OKULAR_UI "mobile" )
@ -70,15 +103,6 @@ ecm_setup_version(${PROJECT_VERSION}
P A C K A G E _ V E R S I O N _ F I L E " $ { C M A K E _ C U R R E N T _ B I N A R Y _ D I R } / O k u l a r 5 C o n f i g V e r s i o n . c m a k e " )
find_package ( Qt5 ${ QT_REQUIRED_VERSION } CONFIG REQUIRED COMPONENTS Core Test Widgets PrintSupport Svg Qml Quick )
if ( BUILD_DESKTOP )
find_package ( Qt5 ${ QT_REQUIRED_VERSION } CONFIG REQUIRED COMPONENTS DBus )
endif ( )
find_package ( Qt5 ${ QT_REQUIRED_VERSION } OPTIONAL_COMPONENTS TextToSpeech )
if ( NOT Qt5TextToSpeech_FOUND )
message ( STATUS "Qt5TextToSpeech not found, speech features will be disabled" )
else ( )
add_definitions ( -DHAVE_SPEECH )
endif ( )
if ( ANDROID )
find_package ( Qt5 ${ QT_REQUIRED_VERSION } CONFIG REQUIRED COMPONENTS AndroidExtras )
@ -91,13 +115,6 @@ ecm_setup_qtplugin_macro_names(
P A C K A G E _ S E T U P _ A U T O M O C _ V A R I A B L E S
)
set ( optionalComponents )
if ( ANDROID )
# w e w a n t t o m a k e s u r e t h a t g e n e r a l l y a l l c o m p o n e n t s a r e f o u n d
set ( optionalComponents "OPTIONAL_COMPONENTS" )
endif ( )
find_package ( KF5 ${ KF5_REQUIRED_VERSION } REQUIRED COMPONENTS
A r c h i v e
B o o k m a r k s
@ -109,23 +126,57 @@ find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
K I O
T h r e a d W e a v e r
W i n d o w S y s t e m
$ { o p t i o n a l C o m p o n e n t s }
D o c T o o l s
J S
W a l l e t
)
if ( BUILD_DESKTOP )
find_package ( KF5 ${ KF5_REQUIRED_VERSION } REQUIRED COMPONENTS Parts Crash IconThemes TextWidgets )
endif ( )
find_package ( KF5Wallet ${ KF5_REQUIRED_VERSION } )
set_okular_optional_package_properties ( KF5Wallet PROPERTIES
P U R P O S E " R e q u i r e d f o r d o c u m e n t s t o r i n g p a s s w o r d s i n s e c u r e w a l l e t s . " )
if ( KF5Wallet_FOUND )
add_definitions ( -DWITH_KWALLET=1 )
endif ( )
find_package ( KF5DocTools ${ KF5_REQUIRED_VERSION } )
set_okular_optional_package_properties ( KF5DocTools PROPERTIES
P U R P O S E " R e q u i r e d f o r c o m p i l i n g a n d i n s t a l l i n g t h e u s e r d o c u m e n t a t i o n . " )
find_package ( KF5JS ${ KF5_REQUIRED_VERSION } )
set_okular_optional_package_properties ( KF5JS PROPERTIES
P U R P O S E " R e q u i r e d f o r s u p p o r t i n g J a v a S c r i p t i n P D F d o c u m e n t s " )
if ( KF5JS_FOUND )
add_definitions ( -DWITH_KJS=1 )
endif ( )
if ( BUILD_DESKTOP )
find_package ( Qt5 ${ QT_REQUIRED_VERSION } CONFIG REQUIRED COMPONENTS DBus )
find_package ( KF5 ${ KF5_REQUIRED_VERSION } REQUIRED COMPONENTS Parts Crash IconThemes TextWidgets )
find_package ( KF5Purpose )
set_okular_optional_package_properties ( KF5Purpose PROPERTIES
D E S C R I P T I O N " A f r a m e w o r k f o r s e r v i c e s a n d a c t i o n s i n t e g r a t i o n "
P U R P O S E " R e q u i r e d f o r e n a b l i n g t h e s h a r e m e n u . " )
if ( KF5Purpose_FOUND )
set ( PURPOSE_FOUND 1 )
else ( )
set ( PURPOSE_FOUND 0 )
endif ( )
find_package ( Qt5TextToSpeech ${ QT_REQUIRED_VERSION } CONFIG )
set_okular_optional_package_properties ( Qt5TextToSpeech PROPERTIES
P U R P O S E " E n a b l e s s p e e c h f e a t u r e s . " )
if ( Qt5TextToSpeech_FOUND )
add_definitions ( -DHAVE_SPEECH )
endif ( )
endif ( )
if ( BUILD_MOBILE )
find_package ( KF5Kirigami2 )
set_package_properties ( KF5Kirigami2 PROPERTIES
D E S C R I P T I O N " A Q t Q u i c k b a s e d c o m p o n e n t s s e t "
P U R P O S E " R e q u i r e d a t r u n t i m e b y t h e m o b i l e a p p "
T Y P E R U N T I M E
)
endif ( )
if ( NOT WIN32 AND NOT ANDROID )
find_package ( KF5 ${ KF5_REQUIRED_VERSION } REQUIRED COMPONENTS
A c t i v i t i e s
@ -133,126 +184,88 @@ if(NOT WIN32 AND NOT ANDROID)
set_package_properties ( "KF5Activities" PROPERTIES
D E S C R I P T I O N " A c t i v i t i e s i n t e r f a c e l i b r a r y "
U R L " h t t p s : / / a p i . k d e . o r g / f r a m e w o r k s / k a c t i v i t i e s / h t m l / "
T Y P E R E C O M M E N D E D
P U R P O S E " R e q u i r e d f o r A c t i v i t i e s i n t e g r a t i o n . " )
endif ( )
find_package ( KF5Kirigami2 )
set_package_properties ( KF5Kirigami2 PROPERTIES
D E S C R I P T I O N " A Q t Q u i c k b a s e d c o m p o n e n t s s e t "
P U R P O S E " R e q u i r e d a t r u n t i m e b y t h e m o b i l e a p p "
T Y P E R U N T I M E
)
find_package ( Phonon4Qt5 CONFIG REQUIRED )
find_package ( KF5Purpose )
set_package_properties ( KF5Purpose PROPERTIES
D E S C R I P T I O N " A f r a m e w o r k f o r s e r v i c e s a n d a c t i o n s i n t e g r a t i o n "
P U R P O S E " R e q u i r e d f o r e n a b l i n g t h e s h a r e m e n u i n O k u l a r "
T Y P E O P T I O N A L
)
if ( KF5Purpose_FOUND )
set ( PURPOSE_FOUND 1 )
else ( )
set ( PURPOSE_FOUND 0 )
endif ( )
set ( CMAKE_MODULE_PATH ${ CMAKE_MODULE_PATH } ${ CMAKE_SOURCE_DIR } /cmake/modules )
find_package ( ZLIB REQUIRED )
find_package ( Poppler "0.86.0" COMPONENTS Qt5 )
set_package_properties ( "Poppler" PROPERTIES
T Y P E R E C O M M E N D E D
set_okular_optional_package_properties ( Poppler PROPERTIES
P U R P O S E " S u p p o r t f o r P D F f i l e s i n o k u l a r . " )
find_package ( Freetype )
set_package_properties ( "FreeType" PROPERTIES
set_okular_optional_package_properties ( Freetype PROPERTIES
D E S C R I P T I O N " A f o n t r e n d e r i n g e n g i n e "
U R L " h t t p s : / / w w w . f r e e t y p e . o r g "
T Y P E R E C O M M E N D E D
P U R P O S E " P r o v i d e s f r e e t y p e f o n t s u p p o r t i n t h e o k u l a r D V I g e n e r a t o r . " )
find_package ( TIFF )
set_package_properties ( "lib TIFF" PROPERTIES
set_okular_optional_ package_properties ( TIFF PROPERTIES
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g a n d w r i t i n g T I F F f o r m a t t e d f i l e s , "
U R L " h t t p : / / w w w . l i b t i f f . o r g "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t f o r T I F F f i l e s i n o k u l a r . " )
find_package ( JPEG )
set_package_properties ( " JPEG" PROPERTIES
set_okular_optional_ package_properties ( JPEG PROPERTIES
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g a n d w r i t i n g J P E G i m a g e f i l e s . "
U R L " h t t p s : / / w w w . i j g . o r g "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t f o r P a l m D B d o c u m e n t s i n o k u l a r . " )
set ( LIBSPECTRE_MINIMUM_VERSION "0.2" )
find_package ( LibSpectre "${LIBSPECTRE_MINIMUM_VERSION}" )
set_package_properties ( LibSpectre PROPERTIES
set_okular_optional_ package_properties ( LibSpectre PROPERTIES
D E S C R I P T I O N " A P o s t S c r i p t r e n d e r i n g l i b r a r y "
U R L " h t t p s : / / l i b s p e c t r e . f r e e d e s k t o p . o r g "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t f o r P S f i l e s i n o k u l a r . " )
find_package ( KF5KExiv2 CONFIG )
set_package_properties ( "LibKExiv2" PROPERTIES
set_okular_optional_ package_properties ( KF5KExiv2 PROPERTIES
D E S C R I P T I O N " W r a p p e r a r o u n d E x i v 2 l i b r a r y "
U R L " h t t p s : / / c o m m i t s . k d e . o r g / l i b k e x i v 2 "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t f o r i m a g e f i l e s " )
P U R P O S E " S u p p o r t f o r e x i f r o t a t i o n i n i m a g e f i l e s . " )
find_package ( CHM )
set_package_properties ( " CHM" PROPERTIES
set_okular_optional_ package_properties ( CHM PROPERTIES
D E S C R I P T I O N " A l i b r a r y f o r d e a l i n g w i t h M i c r o s o f t I T S S / C H M f o r m a t f i l e s "
U R L " h t t p : / / w w w . j e d r e a . c o m / c h m l i b "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t C H M f i l e s i n o k u l a r . " )
find_package ( KF5KHtml CONFIG )
set_package_properties ( " KF5KHtml" PROPERTIES
set_okular_optional_ package_properties ( KF5KHtml PROPERTIES
D E S C R I P T I O N " H T M L r e n d e r i n g l i b r a r y "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t C H M f i l e s i n o k u l a r . " )
find_package ( LibZip )
set_package_properties ( " LibZip" PROPERTIES
set_okular_optional_ package_properties ( LibZip PROPERTIES
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g , c r e a t i n g , a n d m o d i f y i n g z i p a r c h i v e s "
U R L " h t t p s : / / l i b z i p . o r g / "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t C H M f i l e s i n o k u l a r . " )
find_package ( DjVuLibre "3.5.17" )
set_package_properties ( " DjVuLibre" PROPERTIES
set_okular_optional_ package_properties ( DjVuLibre PROPERTIES
D E S C R I P T I O N " A l i b r a r y f o r d e a l i n g w i t h D j V u f o r m a t t e d f i l e s "
U R L " h t t p s : / / d j v u l i b r e . d j v u z o n e . o r g "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t f o r D j V u f i l e s i n o k u l a r . " )
find_package ( ZLIB )
set_package_properties ( "ZLib" PROPERTIES
D E S C R I P T I O N " T h e Z l i b c o m p r e s s i o n l i b r a r y "
U R L " h t t p s : / / w w w . z l i b . n e t "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t f o r P l u c k e r f i l e s i n O k u l a r . " )
find_package ( EPub )
set_package_properties ( "libepub" PROPERTIES
set_okular_optional_package_properties ( EPub PROPERTIES
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g E P u b d o c u m e n t s "
U R L " h t t p : / / s o u r c e f o r g e . n e t / p r o j e c t s / e b o o k - t o o l s "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t f o r E P u b d o c u m e n t s i n O k u l a r . " )
find_package ( QMobipocket "2" CONFIG )
set_package_properties ( "libqmobipocket" PROPERTIES
set_okular_optional_ package_properties ( QMobipocket PROPERTIES
D E S C R I P T I O N " A l i b r a r y f o r r e a d i n g M o b i p o c k e t d o c u m e n t s "
U R L " h t t p s : / / c o m m i t s . k d e . o r g / k d e g r a p h i c s - m o b i p o c k e t "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t f o r M o b i p o c k e t d o c u m e n t s i n O k u l a r . " )
find_package ( Discount )
set_package_properties ( " Discount" PROPERTIES
set_okular_optional_ package_properties ( Discount PROPERTIES
D E S C R I P T I O N " A l i b r a r y t h a t g i v e s y o u f o r m a t t i n g f u n c t i o n s s u i t a b l e f o r m a r k i n g d o w n e n t i r e d o c u m e n t s o r l i n e s o f t e x t "
U R L " h t t p s : / / w w w . p e l l . p o r t l a n d . o r . u s / ~ o r c / C o d e / d i s c o u n t / "
T Y P E R E C O M M E N D E D
P U R P O S E " S u p p o r t f o r M a r k d o w n d o c u m e n t s i n O k u l a r . " )
add_definitions ( -DQT_USE_QSTRINGBUILDER )