Commit cfc82ee9 authored by Alex Richardson's avatar Alex Richardson

Be explicit about the target dependencies

parent 0436b34a
......@@ -2,7 +2,8 @@ project(okular)
cmake_minimum_required(VERSION 2.8.12)
set(QT_MIN_VERSION "5.2.0")
set(QT_REQUIRED_VERSION "5.2.0")
set(KF5_REQUIRED_VERSION "5.8.0")
find_package(ECM 1.7.0 CONFIG REQUIRED)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH})
......@@ -19,15 +20,15 @@ include(KDECMakeSettings)
include(ECMAddTests)
include(ECMAddAppIcon)
find_package(Qt5 CONFIG REQUIRED COMPONENTS Core DBus Test Widgets PrintSupport Svg Qml Quick)
find_package(Qt5 OPTIONAL_COMPONENTS TextToSpeech)
find_package(Qt5 ${QT_REQUIRED_VERSION} CONFIG REQUIRED COMPONENTS Core DBus Test Widgets PrintSupport Svg Qml Quick)
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()
find_package(KF5 REQUIRED COMPONENTS
find_package(KF5 ${KF5_REQUIRED_VERSION} REQUIRED COMPONENTS
Activities
Archive
Bookmarks
......@@ -178,6 +179,7 @@ kconfig_add_kcfg_files(okularcore_SRCS conf/settings_core.kcfgc )
add_library(okularcore SHARED ${okularcore_SRCS})
generate_export_header(okularcore BASE_NAME okularcore)
target_include_directories(okularcore INTERFACE "$<INSTALL_INTERFACE:${KDE_INSTALL_INCLUDEDIR_KF5}>")
# Special handling for linking okularcore on OSX/Apple
IF(APPLE)
......@@ -185,6 +187,7 @@ IF(APPLE)
ENDIF(APPLE)
target_link_libraries(okularcore
PRIVATE
${OKULAR_IOKIT}
KF5::Archive
KF5::JS
......@@ -196,6 +199,12 @@ target_link_libraries(okularcore
Phonon::phonon4qt5
${MATH_LIB}
${ZLIB_LIBRARIES}
PUBLIC # these are included from the installed headers
KF5::CoreAddons
KF5::XmlGui
KF5::ConfigGui
Qt5::PrintSupport
Qt5::Widgets
)
if(LibKScreen_FOUND)
......@@ -285,7 +294,7 @@ kconfig_add_kcfg_files(okularpart_SRCS conf/settings.kcfgc )
add_library(okularpart MODULE ${okularpart_SRCS})
generate_export_header(okularpart BASE_NAME okularpart)
target_link_libraries(okularpart okularcore Qt5::Svg KF5::Parts ${MATH_LIB} Phonon::phonon4qt5 KF5::Solid)
target_link_libraries(okularpart okularcore Qt5::Svg KF5::Parts ${MATH_LIB} Phonon::phonon4qt5 KF5::Solid KF5::KDELibs4Support KF5::Wallet KF5::Archive)
if (Qt5TextToSpeech_FOUND)
target_link_libraries(okularpart Qt5::TextToSpeech)
......
......@@ -41,7 +41,7 @@ class PartThatHijacksQueryClose : public Okular::Part
{
public:
PartThatHijacksQueryClose(QWidget* parentWidget, QObject* parent,
const QVariantList& args, KComponentData componentData)
const QVariantList& args)
: Okular::Part(parentWidget, parent, args),
behavior(PassThru)
{}
......@@ -84,7 +84,7 @@ void PartTest::testReload()
void PartTest::testCanceledReload()
{
QVariantList dummyArgs;
PartThatHijacksQueryClose part(NULL, NULL, dummyArgs, KGlobal::mainComponent());
PartThatHijacksQueryClose part(NULL, NULL, dummyArgs);
QVERIFY( openDocument(&part, KDESRCDIR "data/file1.pdf") );
// When queryClose() returns false, the reload operation is canceled (as if
......
......@@ -15,7 +15,6 @@
#include <QtGui/QPainterPath>
#include <QtGui/QTransform>
#include <QtCore/QDebug>
#include <math.h>
#include "global.h"
#include "okularcore_export.h"
......
......@@ -22,13 +22,13 @@
#include <QtPrintSupport/QPrinter>
#include <QtXml/QDomDocument>
#include <kcomponentdata.h>
#include <QMimeType>
#include <QUrl>
class QPrintDialog;
class KBookmark;
class KConfigDialog;
class KComponentData;
class KXMLGUIClient;
class DocumentItem;
......
......@@ -19,7 +19,7 @@ add_library(okularGenerator_comicbook MODULE ${okularGenerator_comicbook_PART_SR
target_link_libraries(okularGenerator_comicbook okularcore KF5::KIOCore)
if (UNIX)
find_package(KF5 REQUIRED Pty)
target_link_libraries(okularGenerator_comicbook KF5::Pty )
target_link_libraries(okularGenerator_comicbook KF5::Pty KF5::I18n KF5::Archive KF5::KDELibs4Support)
endif (UNIX)
install(TARGETS okularGenerator_comicbook DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -15,7 +15,7 @@ set(okularGenerator_djvu_SRCS
add_library(okularGenerator_djvu MODULE ${okularGenerator_djvu_SRCS})
target_link_libraries(okularGenerator_djvu okularcore ${DJVULIBRE_LIBRARY} KF5::KDELibs4Support Qt5::Gui Qt5::PrintSupport)
target_link_libraries(okularGenerator_djvu okularcore ${DJVULIBRE_LIBRARY} KF5::KDELibs4Support)
install(TARGETS okularGenerator_djvu DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -48,7 +48,7 @@ set(okularGenerator_dvi_SRCS
add_library(okularGenerator_dvi MODULE ${okularGenerator_dvi_SRCS})
target_link_libraries(okularGenerator_dvi okularcore)
target_link_libraries(okularGenerator_dvi okularcore KF5::I18n KF5::KDELibs4Support)
if (FREETYPE_FOUND)
target_link_libraries(okularGenerator_dvi ${FREETYPE_LIBRARIES})
endif (FREETYPE_FOUND)
......
......@@ -9,7 +9,7 @@ set(okularGenerator_fax_PART_SRCS generator_fax.cpp faxdocument.cpp faxexpand.cp
add_library(okularGenerator_fax MODULE ${okularGenerator_fax_PART_SRCS})
target_link_libraries(okularGenerator_fax okularcore Qt5::Xml)
target_link_libraries(okularGenerator_fax okularcore KF5::I18n Qt5::Xml)
install(TARGETS okularGenerator_fax DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -15,7 +15,7 @@ set(okularGenerator_fb_PART_SRCS
add_library(okularGenerator_fb MODULE ${okularGenerator_fb_PART_SRCS})
target_link_libraries(okularGenerator_fb okularcore KF5::KIOCore Qt5::Xml)
target_link_libraries(okularGenerator_fb okularcore KF5::Archive KF5::I18n KF5::KIOCore Qt5::Xml)
install(TARGETS okularGenerator_fb DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -8,7 +8,7 @@ include_directories(
set(okularGenerator_kimgio_PART_SRCS generator_kimgio.cpp )
add_library(okularGenerator_kimgio MODULE ${okularGenerator_kimgio_PART_SRCS})
target_link_libraries(okularGenerator_kimgio okularcore KF5::KExiv2)
target_link_libraries(okularGenerator_kimgio okularcore KF5::KExiv2 KF5::KDELibs4Support)
install(TARGETS okularGenerator_kimgio DESTINATION ${KDE_INSTALL_PLUGINDIR})
add_definitions( -DKDESRCDIR="${CMAKE_CURRENT_SOURCE_DIR}/" )
......
......@@ -27,7 +27,7 @@ set(okularGenerator_ooo_PART_SRCS
add_library(okularGenerator_ooo MODULE ${okularGenerator_ooo_PART_SRCS})
target_link_libraries(okularGenerator_ooo okularcore KF5::KIOCore ${MATH_LIB} Qt5::Xml)
target_link_libraries(okularGenerator_ooo okularcore KF5::KIOCore KF5::Archive KF5::I18n KF5::Wallet KF5::KDELibs4Support ${MATH_LIB} Qt5::Xml)
if (Qca-qt5_FOUND)
target_link_libraries(okularGenerator_ooo okularcore qca-qt5)
endif ()
......
......@@ -23,7 +23,7 @@ set(okularGenerator_plucker_SRCS
add_library(okularGenerator_plucker MODULE ${okularGenerator_plucker_SRCS} ${qunpluck_SRCS})
target_link_libraries(okularGenerator_plucker okularcore KF5::KIOCore ${MATH_LIB} ${JPEG_LIBRARY} ${ZLIB_LIBRARY})
target_link_libraries(okularGenerator_plucker okularcore KF5::KIOCore KF5::I18n ${MATH_LIB} ${JPEG_LIBRARY} ${ZLIB_LIBRARY})
install(TARGETS okularGenerator_plucker DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -35,7 +35,7 @@ kconfig_add_kcfg_files(okularGenerator_poppler_PART_SRCS conf/pdfsettings.kcfgc
add_library(okularGenerator_poppler MODULE ${okularGenerator_poppler_PART_SRCS})
target_link_libraries(okularGenerator_poppler ${POPPLER_LIBRARY} okularcore Qt5::Xml Qt5::Widgets Qt5::Gui )
target_link_libraries(okularGenerator_poppler ${POPPLER_LIBRARY} okularcore KF5::I18n KF5::KDELibs4Support Qt5::Xml)
install(TARGETS okularGenerator_poppler DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -23,7 +23,7 @@ kconfig_add_kcfg_files(okularGenerator_ghostview_SRCS conf/gssettings.kcfgc )
add_library(okularGenerator_ghostview MODULE ${okularGenerator_ghostview_SRCS})
target_link_libraries(okularGenerator_ghostview okularcore ${LIBSPECTRE_LIBRARY} KF5::KDELibs4Support Qt5::Xml Qt5::PrintSupport)
target_link_libraries(okularGenerator_ghostview okularcore ${LIBSPECTRE_LIBRARY} KF5::KDELibs4Support Qt5::Xml)
install(TARGETS okularGenerator_ghostview DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -11,7 +11,7 @@ set(okularGenerator_tiff_SRCS
)
add_library(okularGenerator_tiff MODULE ${okularGenerator_tiff_SRCS})
target_link_libraries(okularGenerator_tiff okularcore ${TIFF_LIBRARIES})
target_link_libraries(okularGenerator_tiff okularcore ${TIFF_LIBRARIES} KF5::KDELibs4Support)
install(TARGETS okularGenerator_tiff DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -14,7 +14,7 @@ set(okularGenerator_txt_SRCS
add_library(okularGenerator_txt MODULE ${okularGenerator_txt_SRCS})
target_link_libraries(okularGenerator_txt okularcore Qt5::Core)
target_link_libraries(okularGenerator_txt okularcore Qt5::Core KF5::I18n)
install(TARGETS okularGenerator_txt DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
......@@ -12,7 +12,7 @@ set(okularGenerator_xps_SRCS
add_library(okularGenerator_xps MODULE ${okularGenerator_xps_SRCS})
target_link_libraries(okularGenerator_xps okularcore KF5::KIOCore Qt5::Xml)
target_link_libraries(okularGenerator_xps okularcore KF5::Archive KF5::I18n KF5::KIOCore Qt5::PrintSupport Qt5::Xml)
install(TARGETS okularGenerator_xps DESTINATION ${KDE_INSTALL_PLUGINDIR})
......
Markdown is supported
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