[poppler] Branch 'cpp-frontend' - 2 commits - configure.ac cpp/CMakeLists.txt cpp/.gitignore cpp/Makefile.am cpp/poppler-version.cpp cpp/poppler-version.h.in .gitignore

Pino Toscano pino at kemper.freedesktop.org
Sun Dec 13 17:30:42 PST 2009


 .gitignore               |    1 +
 configure.ac             |    2 ++
 cpp/.gitignore           |    1 +
 cpp/CMakeLists.txt       |    5 +++++
 cpp/Makefile.am          |    6 ++++--
 cpp/poppler-version.cpp  |   41 +++++++++++++++++++++++++++++++++++++++++
 cpp/poppler-version.h.in |   39 +++++++++++++++++++++++++++++++++++++++
 7 files changed, 93 insertions(+), 2 deletions(-)

New commits:
commit 2d13ac31671b2007e44a90f45a82cb3adfa9c80c
Author: Pino Toscano <pino at kde.org>
Date:   Mon Dec 14 02:30:06 2009 +0100

    update ignore files

diff --git a/.gitignore b/.gitignore
index 11d96b9..d000352 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@ libtool
 ltmain.sh
 missing
 poppler-cairo.pc
+poppler-cpp.pc
 poppler-glib.pc
 poppler-qt.pc
 poppler-qt4.pc
diff --git a/cpp/.gitignore b/cpp/.gitignore
index 62535c7..0556b92 100644
--- a/cpp/.gitignore
+++ b/cpp/.gitignore
@@ -4,3 +4,4 @@
 *.lo
 Makefile
 Makefile.in
+poppler-version.h
commit 01e902e40ca15acf0319e37d39a271d6875bfce9
Author: Pino Toscano <pino at kde.org>
Date:   Mon Dec 14 02:02:47 2009 +0100

    [cpp] add a version header+functions
    
    this way, it is possible to get (either at build time and at runtime)
    the version of the current poppler-cpp library
    
    poppler-config.h is generated by the build system (autotools or cmake)
    with the correct version information

diff --git a/configure.ac b/configure.ac
index a7d61f7..70bac6c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -547,6 +547,7 @@ AC_SUBST(PC_REQUIRES_PRIVATE)
 AC_SUBST([POPPLER_MAJOR_VERSION],[poppler_version_major])
 AC_SUBST([POPPLER_MINOR_VERSION],[poppler_version_minor])
 AC_SUBST([POPPLER_MICRO_VERSION],[poppler_version_micro])
+AC_SUBST([POPPLER_VERSION],[poppler_version])
 
 AC_OUTPUT([
 Makefile
@@ -566,6 +567,7 @@ qt4/src/Makefile
 qt4/tests/Makefile
 qt4/demos/Makefile
 cpp/Makefile
+cpp/poppler-version.h
 poppler.pc
 poppler-cairo.pc
 poppler-splash.pc
diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt
index 42fbca2..3f8e9d9 100644
--- a/cpp/CMakeLists.txt
+++ b/cpp/CMakeLists.txt
@@ -1,7 +1,10 @@
 include_directories(
+  ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_BINARY_DIR}
 )
 
+configure_file(poppler-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h @ONLY)
+
 set(poppler_cpp_SRCS
   poppler-document.cpp
   poppler-embedded-file.cpp
@@ -11,6 +14,7 @@ set(poppler_cpp_SRCS
   poppler-page-transition.cpp
   poppler-private.cpp
   poppler-toc.cpp
+  poppler-version.cpp
 )
 
 add_library(poppler-cpp SHARED ${poppler_cpp_SRCS})
@@ -30,5 +34,6 @@ install(FILES
   poppler-page-transition.h
   poppler-rectangle.h
   poppler-toc.h
+  ${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h
   DESTINATION include/poppler/cpp)
 
diff --git a/cpp/Makefile.am b/cpp/Makefile.am
index 58b8dd1..b6c2d8e 100644
--- a/cpp/Makefile.am
+++ b/cpp/Makefile.am
@@ -13,7 +13,8 @@ poppler_include_HEADERS =			\
 	poppler-page.h				\
 	poppler-page-transition.h		\
 	poppler-rectangle.h			\
-	poppler-toc.h
+	poppler-toc.h				\
+	poppler-version.h
 
 lib_LTLIBRARIES = libpoppler-cpp.la
 libpoppler_cpp_la_SOURCES =			\
@@ -24,7 +25,8 @@ libpoppler_cpp_la_SOURCES =			\
 	poppler-page.cpp			\
 	poppler-page-transition.cpp		\
 	poppler-private.cpp			\
-	poppler-toc.cpp
+	poppler-toc.cpp				\
+	poppler-version.cpp
 
 libpoppler_cpp_la_LIBADD = 			\
 	$(top_builddir)/poppler/libpoppler.la
diff --git a/cpp/poppler-version.cpp b/cpp/poppler-version.cpp
new file mode 100644
index 0000000..89f95a3
--- /dev/null
+++ b/cpp/poppler-version.cpp
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2009, Pino Toscano <pino at kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "poppler-version.h"
+
+using namespace poppler;
+
+std::string version_string()
+{
+    return std::string(POPPLER_VERSION);
+}
+
+unsigned int version_major()
+{
+    return POPPLER_VERSION_MAJOR;
+}
+
+unsigned int version_minor()
+{
+    return POPPLER_VERSION_MINOR;
+}
+
+unsigned int version_micro()
+{
+    return POPPLER_VERSION_MICRO;
+}
diff --git a/cpp/poppler-version.h.in b/cpp/poppler-version.h.in
new file mode 100644
index 0000000..cf6bce6
--- /dev/null
+++ b/cpp/poppler-version.h.in
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2009, Pino Toscano <pino at kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef POPPLER_VERSION_H
+#define POPPLER_VERSION_H
+
+#include "poppler-global.h"
+
+#define POPPLER_VERSION "@POPPLER_VERSION@"
+#define POPPLER_VERSION_MAJOR @POPPLER_MAJOR_VERSION@
+#define POPPLER_VERSION_MINOR @POPPLER_MINOR_VERSION@
+#define POPPLER_VERSION_MICRO @POPPLER_MICRO_VERSION@
+
+namespace poppler
+{
+
+POPPLER_CPP_EXPORT std::string version_string();
+POPPLER_CPP_EXPORT unsigned int version_major();
+POPPLER_CPP_EXPORT unsigned int version_minor();
+POPPLER_CPP_EXPORT unsigned int version_micro();
+
+}
+
+#endif


More information about the poppler mailing list