1 --- CMakeLists.txt.orig 2017-05-21 23:01:39.000000000 +0200
2 +++ CMakeLists.txt 2017-05-22 14:12:44.635191266 +0200
3 @@ -35,8 +35,14 @@
4 option(BUILD_QT5_TESTS "Whether compile the Qt5 test programs." ON)
5 option(BUILD_CPP_TESTS "Whether compile the CPP test programs." ON)
6 option(ENABLE_SPLASH "Build the Splash graphics backend." ON)
7 +option(ENABLE_CAIRO "Build the Cairo graphics backend." ON)
8 option(ENABLE_UTILS "Compile poppler command line utils." ON)
9 option(ENABLE_CPP "Compile poppler cpp wrapper." ON)
10 +option(ENABLE_GLIB "Compile poppler glib wrapper." ON)
11 +option(ENABLE_QT4 "Compile poppler QT4 wrapper." ON)
12 +option(ENABLE_QT5 "Compile poppler QT5 wrapper." ON)
13 +option(ENABLE_NSS3 "Build with NSS3 support." OFF)
14 +
15 set(ENABLE_LIBOPENJPEG "auto" CACHE STRING "Use libopenjpeg for JPX streams. Possible values: auto, openjpeg1, openjpeg2, unmaintained, none. 'auto' prefers openjpeg2 over openjpeg1 if both are available. 'unmaintained' gives you the internal unmaintained decoder. Use at your own risk. 'none' compiles no JPX decoder at all. Default: auto")
16 set(ENABLE_CMS "auto" CACHE STRING "Use color management system. Possible values: auto, lcms1, lcms2. 'auto' prefers lcms2 over lcms1 if both are available. Unset to disable color management system.")
17 set(ENABLE_DCTDECODER "libjpeg" CACHE STRING "Use libjpeg for DCT streams. Possible values: libjpeg, unmaintained, none. will use libjpeg if available or fail if not. 'unmaintained' gives you the internal unmaintained decoder. Use at your own risk. 'none' compiles no DCT decoder at all. Default: libjpeg")
18 @@ -127,43 +133,46 @@
19 message(FATAL_ERROR "Invalid ENABLE_DCTDECODER value.")
20 endif()
21 macro_optional_find_package(Qt4)
22 -if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
23 - find_package(Qt5Core)
24 - find_package(Qt5Gui)
25 - find_package(Qt5Xml)
26 - find_package(Qt5Widgets)
27 - find_package(Qt5Test)
28 - if (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
29 - set(QT5_FOUND true)
30 - else ()
31 - message("-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found")
32 +if(ENABLE_QT5)
33 + if(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
34 + find_package(Qt5Core)
35 + find_package(Qt5Gui)
36 + find_package(Qt5Xml)
37 + find_package(Qt5Widgets)
38 + find_package(Qt5Test)
39 + if (Qt5Core_FOUND AND Qt5Gui_FOUND AND Qt5Xml_FOUND AND Qt5Widgets_FOUND AND Qt5Test_FOUND)
40 + set(QT5_FOUND true)
41 + else ()
42 + message("-- Package Qt5Core or Qt5Gui or Qt5Xml or Qt5Widgets or Qt5Test not found")
43 + set(QT5_FOUND false)
44 + endif()
45 + else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
46 set(QT5_FOUND false)
47 - endif()
48 -else(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
49 - set(QT5_FOUND false)
50 - message("-- CMake >= 2.8.8 is needed to enable Qt5")
51 -endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
52 -
53 -macro_optional_find_package(Cairo ${CAIRO_VERSION})
54 -if(CAIRO_FOUND)
55 - set(HAVE_CAIRO ${CAIRO_FOUND})
56 - set(CAIRO_FEATURE "#define POPPLER_HAS_CAIRO 1")
57 - set(CAIRO_REQ "cairo")
58 - set(POPPLER_GLIB_DISABLE_DEPRECATED "")
59 - set(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES "")
60 - macro_optional_find_package(GLIB)
61 - if(GLIB_FOUND)
62 - set(ENABLE_GLIB ON)
63 - # Check for introspection
64 - macro_optional_find_package(GObjectIntrospection 0.9.12)
65 - set(HAVE_INTROSPECTION ${INTROSPECTION_FOUND})
66 - set(POPPLER_GLIB_DISABLE_DEPRECATED "${POPPLER_GLIB_DISABLE_DEPRECATED} -DG_DISABLE_DEPRECATED")
67 - set(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES "${POPPLER_GLIB_DISABLE_SINGLE_INCLUDES} -DG_DISABLE_SINGLE_INCLUDES")
68 - macro_optional_find_package(GTK)
69 - endif(GLIB_FOUND)
70 -else(CAIRO_FOUND)
71 - set(CAIRO_FEATURE "#undef POPPLER_HAS_CAIRO")
72 -endif(CAIRO_FOUND)
73 + message("-- CMake >= 2.8.8 is needed to enable Qt5")
74 + endif(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION} VERSION_GREATER 2.8.7)
75 +endif()
76 +if(ENABLE_CAIRO)
77 + macro_optional_find_package(Cairo ${CAIRO_VERSION})
78 + if(CAIRO_FOUND)
79 + set(HAVE_CAIRO ${CAIRO_FOUND})
80 + set(CAIRO_FEATURE "#define POPPLER_HAS_CAIRO 1")
81 + set(CAIRO_REQ "cairo")
82 + set(POPPLER_GLIB_DISABLE_DEPRECATED "")
83 + set(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES "")
84 + macro_optional_find_package(GLIB)
85 + if(ENABLE_GLIB)
86 + set(ENABLE_GLIB ON)
87 + # Check for introspection
88 + macro_optional_find_package(GObjectIntrospection 0.9.12)
89 + set(HAVE_INTROSPECTION ${INTROSPECTION_FOUND})
90 + set(POPPLER_GLIB_DISABLE_DEPRECATED "${POPPLER_GLIB_DISABLE_DEPRECATED} -DG_DISABLE_DEPRECATED")
91 + set(POPPLER_GLIB_DISABLE_SINGLE_INCLUDES "${POPPLER_GLIB_DISABLE_SINGLE_INCLUDES} -DG_DISABLE_SINGLE_INCLUDES")
92 + macro_optional_find_package(GTK)
93 + endif(ENABLE_GLIB)
94 + else(CAIRO_FOUND)
95 + set(CAIRO_FEATURE "#undef POPPLER_HAS_CAIRO")
96 + endif(CAIRO_FOUND)
97 +endif(ENABLE_CAIRO)
98 if(ENABLE_CPP)
99 macro_optional_find_package(Iconv)
100 set(ENABLE_CPP ${ICONV_FOUND})
101 @@ -277,10 +286,10 @@
102 include_directories(${ZLIB_INCLUDE_DIR})
103 endif(ENABLE_ZLIB)
104
105 -if (NSS3_FOUND)
106 +if (ENABLE_NSS3 AND NSS3_FOUND)
107 add_definitions(${NSS3_CFLAGS})
108 set(ENABLE_NSS3 ON)
109 -endif(NSS3_FOUND)
110 +endif(ENABLE_NSS3 AND NSS3_FOUND)
111 if(JPEG_FOUND)
112 include_directories(${JPEG_INCLUDE_DIR})
113 endif(JPEG_FOUND)
114 @@ -716,12 +725,12 @@
115 add_subdirectory(glib)
116 endif(ENABLE_GLIB)
117 add_subdirectory(test)
118 -if(QT4_FOUND)
119 +if(ENABLE_QT4)
120 add_subdirectory(qt4)
121 -endif(QT4_FOUND)
122 -if(QT5_FOUND)
123 +endif(ENABLE_QT4)
124 +if(ENABLE_QT5)
125 add_subdirectory(qt5)
126 -endif(QT5_FOUND)
127 +endif(ENABLE_QT5)
128 if(ENABLE_CPP)
129 add_subdirectory(cpp)
130 endif(ENABLE_CPP)
131 @@ -743,12 +752,12 @@
132 if(ENABLE_SPLASH)
133 poppler_create_install_pkgconfig(poppler-splash.pc lib${LIB_SUFFIX}/pkgconfig)
134 endif(ENABLE_SPLASH)
135 -if(QT4_FOUND)
136 +if(ENABLE_QT4)
137 poppler_create_install_pkgconfig(poppler-qt4.pc lib${LIB_SUFFIX}/pkgconfig)
138 -endif(QT4_FOUND)
139 -if(QT5_FOUND)
140 +endif(ENABLE_QT4)
141 +if(ENABLE_QT5)
142 poppler_create_install_pkgconfig(poppler-qt5.pc lib${LIB_SUFFIX}/pkgconfig)
143 -endif(QT5_FOUND)
144 +endif(ENABLE_QT5)
145 if(ENABLE_GLIB)
146 poppler_create_install_pkgconfig(poppler-glib.pc lib${LIB_SUFFIX}/pkgconfig)
147 endif(ENABLE_GLIB)
148 @@ -767,8 +776,8 @@
149 message(" with CMYK support")
150 endif()
151 show_end_message_yesno("cairo output" CAIRO_FOUND)
152 -show_end_message_yesno("qt4 wrapper" QT4_FOUND)
153 -show_end_message_yesno("qt5 wrapper" QT5_FOUND)
154 +show_end_message_yesno("qt4 wrapper" ENABLE_QT4)
155 +show_end_message_yesno("qt5 wrapper" ENABLE_QT5)
156 show_end_message_yesno("glib wrapper" ENABLE_GLIB)
157 show_end_message_yesno(" introspection" INTROSPECTION_FOUND)
158 show_end_message_yesno("cpp wrapper" ENABLE_CPP)
|