CMakeLists.txt 2.43 KB
Newer Older
1
remove_definitions(-DTRANSLATION_DOMAIN="okular")
2
3
add_definitions(-DTRANSLATION_DOMAIN="okular_poppler")

4
add_subdirectory( conf )
5

6
set(CMAKE_REQUIRED_LIBRARIES Poppler::Qt5 Qt5::Core Qt5::Gui)
Albert Astals Cid's avatar
Albert Astals Cid committed
7

8
9
10
11
12
13
14
15
16
17
check_cxx_source_compiles("
#include <poppler-qt5.h>
#include <QColor>
int main()
{
    Poppler::TextAnnotation *annot = new Poppler::TextAnnotation( Poppler::TextAnnotation::InPlace );
    annot->setTextColor( Qt::blue );
    return 0;
}
" HAVE_POPPLER_0_69)
18
19
20
21
22
23

check_cxx_source_compiles("
#include <poppler-version.h>
int main()
{
    QString s = Poppler::Version::string();
24
    (void)s;
25
26
27
    return 0;
}
" HAVE_POPPLER_0_73)
28

29
30
31
32
33
34
35
36
37
38
check_cxx_source_compiles("
#include <poppler-qt5.h>
int main()
{
    Poppler::Document *document = nullptr;
    (void)document->outline();
    return 0;
}
" HAVE_POPPLER_0_74)

39
40
41
42
43
44
check_cxx_source_compiles("
#include <poppler-form.h>
#include <poppler-qt5.h>
int main()
{
    Poppler::FormFieldIcon icon(nullptr);
45
    Poppler::FormFieldButton *button = nullptr;
46
47
48
    button->setIcon( icon );
    return 0;
}
49
" HAVE_POPPLER_0_79)
50

51
52
53
54
55
56
check_cxx_source_compiles("
#include <poppler-qt5.h>
int main()
{
    Poppler::FontInfo info;
    QString substituteName = info.substituteName();
57
    (void)substituteName;
58
59
60
61
    return 0;
}
" HAVE_POPPLER_0_80)

62
63
64
65
66
67
68
69
70
71
check_cxx_source_compiles("
#include <poppler-form.h>
int main()
{
    Poppler::FormFieldChoice *ffc = nullptr;
    ffc->choicesWithExportValues();
    return 0;
}
" HAVE_POPPLER_0_87)

72
73
74
75
76
configure_file(
   ${CMAKE_CURRENT_SOURCE_DIR}/config-okular-poppler.h.cmake
   ${CMAKE_CURRENT_BINARY_DIR}/config-okular-poppler.h
)

77
include_directories(
78
   ${CMAKE_CURRENT_SOURCE_DIR}/../..
79
)
80
81
82

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

83
84
set(okularGenerator_poppler_PART_SRCS
   generator_pdf.cpp
Pino Toscano's avatar
Pino Toscano committed
85
   formfields.cpp
86
   annots.cpp
87
   pdfsignatureutils.cpp
88
89
)

Vishesh Handa's avatar
Vishesh Handa committed
90
ki18n_wrap_ui(okularGenerator_poppler_PART_SRCS
91
92
93
   conf/pdfsettingswidget.ui
)

94
kconfig_add_kcfg_files(okularGenerator_poppler_PART_SRCS conf/pdfsettings.kcfgc )
95

96
okular_add_generator(okularGenerator_poppler ${okularGenerator_poppler_PART_SRCS})
97

98
target_link_libraries(okularGenerator_poppler okularcore KF5::I18n KF5::Completion Poppler::Qt5 Qt5::Xml)
99
100

########### install files ###############
Olivier Churlaud's avatar
Olivier Churlaud committed
101
install( FILES okularPoppler.desktop  DESTINATION  ${KDE_INSTALL_KSERVICES5DIR} )
102
install( PROGRAMS okularApplication_pdf.desktop org.kde.mobile.okular_pdf.desktop  DESTINATION  ${KDE_INSTALL_APPDIR} )
103
install( FILES org.kde.okular-poppler.metainfo.xml DESTINATION ${KDE_INSTALL_METAINFODIR} )