[CMake] Add poppler version defines and version check macro
Add POPPLER_[MAJOR|MINOR|MICRO]_VERSION defines and
POPPLER_CHECK_VERSION macro. FDO bug #22091.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 9e81b39..0fbc49a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,7 +11,10 @@
include(MacroEnsureVersion)
include(MacroBoolTo01)
-set(POPPLER_VERSION "0.11.0")
+set(POPPLER_MAJOR_VERSION "0")
+set(POPPLER_MINOR_VERSION "11")
+set(POPPLER_MICRO_VERSION "0")
+set(POPPLER_VERSION "${POPPLER_MAJOR_VERSION}.${POPPLER_MINOR_VERSION}.${POPPLER_MICRO_VERSION}")
# command line switches
option(ENABLE_XPDF_HEADERS "Install unsupported xpdf headers." OFF)
diff --git a/glib/poppler-features.h.cmake b/glib/poppler-features.h.cmake
index 76ff423..1f79ce4 100644
--- a/glib/poppler-features.h.cmake
+++ b/glib/poppler-features.h.cmake
@@ -21,4 +21,13 @@
@CAIRO_FEATURE@
+#define POPPLER_MAJOR_VERSION (@POPPLER_MAJOR_VERSION@)
+#define POPPLER_MINOR_VERSION (@POPPLER_MINOR_VERSION@)
+#define POPPLER_MICRO_VERSION (@POPPLER_MICRO_VERSION@)
+
+#define POPPLER_CHECK_VERSION(major,minor,micro) \
+ (POPPLER_MAJOR_VERSION > (major) || \
+ (POPPLER_MAJOR_VERSION == (major) && POPPLER_MINOR_VERSION > (minor)) || \
+ (POPPLER_MAJOR_VERSION == (major) && POPPLER_MINOR_VERSION == (minor) && POPPLER_MICRO_VERSION >= (micro)))
+
#endif /* __POPPLER_FEATURES_H__ */