[poppler] CMakeLists.txt qt4/src qt4/tests

Albert Astals Cid aacid at kemper.freedesktop.org
Tue Feb 26 13:46:37 PST 2008


 CMakeLists.txt                               |    5 +++++
 qt4/src/CMakeLists.txt                       |    3 +++
 qt4/src/poppler-annotation-helper.h          |    1 +
 qt4/src/poppler-annotation-private.h         |    1 +
 qt4/src/poppler-annotation.h                 |   19 ++++++++++---------
 qt4/src/poppler-converter-private.h          |    1 +
 qt4/src/poppler-export.h                     |    6 +++---
 qt4/src/poppler-form.h                       |    9 +++++----
 qt4/src/poppler-link-extractor-private.h     |    1 +
 qt4/src/poppler-link.h                       |   17 +++++++++--------
 qt4/src/poppler-page-private.h               |    1 +
 qt4/src/poppler-private.h                    |    1 +
 qt4/src/poppler-qiodeviceoutstream-private.h |    1 +
 qt4/src/poppler-qt4.h                        |   21 +++++++++++----------
 qt4/tests/CMakeLists.txt                     |    6 ++++++
 15 files changed, 59 insertions(+), 34 deletions(-)

New commits:
commit 2034d57c700049bc9a6565bbb818e1c9f4467784
Author: Albert Astals Cid <aacid at kde.org>
Date:   Tue Feb 26 22:46:29 2008 +0100

    Now for real: Add special casing in cmake buildsystem for MSVC, also add Export markers to qt4 classes, although symbol visibility is only used on MSVC at the moment

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b33b2c7..5b130bf 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -217,7 +217,12 @@ if(WIN32)
   set(poppler_LIBS ${poppler_LIBS} gdi32)
 endif(WIN32)
 
+if(MSVC)
+set(poppler_SRCS ${poppler_SRCS} poppler/GlobalParamsWin.cc)
+add_library(poppler STATIC ${poppler_SRCS})
+else(MSVC)
 add_library(poppler SHARED ${poppler_SRCS})
+endif(MSVC)
 set_target_properties(poppler PROPERTIES VERSION 2.0.0 SOVERSION 2)
 target_link_libraries(poppler ${poppler_LIBS})
 install(TARGETS poppler RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
diff --git a/qt4/src/CMakeLists.txt b/qt4/src/CMakeLists.txt
index 29ef8e5..cd6014e 100644
--- a/qt4/src/CMakeLists.txt
+++ b/qt4/src/CMakeLists.txt
@@ -32,6 +32,9 @@ endif (ENABLE_SPLASH)
 add_library(poppler-qt4 SHARED ${poppler_qt4_SRCS})
 set_target_properties(poppler-qt4 PROPERTIES VERSION 2.0.0 SOVERSION 2)
 target_link_libraries(poppler-qt4 poppler ${QT4_QTCORE_LIBRARY} ${QT4_QTGUI_LIBRARY} ${QT4_QTXML_LIBRARY})
+if(MSVC)
+target_link_libraries(poppler-qt4 poppler ${poppler_LIBS})
+endif(MSVC)
 install(TARGETS poppler-qt4 RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib)
 
 install(FILES
diff --git a/qt4/src/poppler-annotation-helper.h b/qt4/src/poppler-annotation-helper.h
index 0215729..51ae087 100644
--- a/qt4/src/poppler-annotation-helper.h
+++ b/qt4/src/poppler-annotation-helper.h
@@ -19,6 +19,7 @@
  */
 
 #include <QtCore/QDebug>
+#include "poppler-export.h"
 
 class QColor;
 
diff --git a/qt4/src/poppler-annotation-private.h b/qt4/src/poppler-annotation-private.h
index b428347..b4d0ca0 100644
--- a/qt4/src/poppler-annotation-private.h
+++ b/qt4/src/poppler-annotation-private.h
@@ -20,6 +20,7 @@
 #define _POPPLER_ANNOTATION_PRIVATE_H_
 
 #include "poppler-annotation.h"
+#include "poppler-export.h"
 
 namespace Poppler
 {
diff --git a/qt4/src/poppler-annotation.h b/qt4/src/poppler-annotation.h
index efc9948..520aada 100644
--- a/qt4/src/poppler-annotation.h
+++ b/qt4/src/poppler-annotation.h
@@ -29,6 +29,7 @@
 #include <QtGui/QColor>
 #include <QtGui/QFont>
 #include <QtXml/QDomDocument>
+#include "poppler-export.h"
 
 namespace Poppler {
 
@@ -47,7 +48,7 @@ class Link;
  * \short Helper class for (recursive) Annotation retrieval/storage.
  *
  */
-class AnnotationUtils
+class POPPLER_QT4_EXPORT AnnotationUtils
 {
     public:
         /**
@@ -80,7 +81,7 @@ class AnnotationUtils
  * An Annotation is an object (text note, highlight, sound, popup window, ..)
  * contained by a Page in the document.
  */
-class Annotation
+class POPPLER_QT4_EXPORT Annotation
 {
   public:
     // enum definitions
@@ -193,7 +194,7 @@ class Annotation
  * A text annotation is an object showing some text directly on the page, or
  * linked to the contents using an icon shown on a page.
  */
-class TextAnnotation : public Annotation
+class POPPLER_QT4_EXPORT TextAnnotation : public Annotation
 {
   public:
     TextAnnotation();
@@ -262,7 +263,7 @@ class TextAnnotation : public Annotation
  *
  * This annotation represents a polygon (or polyline) to be drawn on a page.
  */
-class LineAnnotation : public Annotation
+class POPPLER_QT4_EXPORT LineAnnotation : public Annotation
 {
   public:
     LineAnnotation();
@@ -314,7 +315,7 @@ class LineAnnotation : public Annotation
  * The geometric annotation represents a geometric figure, like a rectangle or
  * an ellipse.
  */
-class GeomAnnotation : public Annotation
+class POPPLER_QT4_EXPORT GeomAnnotation : public Annotation
 {
   public:
     GeomAnnotation();
@@ -345,7 +346,7 @@ class GeomAnnotation : public Annotation
  *
  * The higlight annotation represents some areas of text being "highlighted".
  */
-class HighlightAnnotation : public Annotation
+class POPPLER_QT4_EXPORT HighlightAnnotation : public Annotation
 {
   public:
     HighlightAnnotation();
@@ -408,7 +409,7 @@ class HighlightAnnotation : public Annotation
  *
  * A simple annotation drawing a stamp on a page.
  */
-class StampAnnotation : public Annotation
+class POPPLER_QT4_EXPORT StampAnnotation : public Annotation
 {
   public:
     StampAnnotation();
@@ -455,7 +456,7 @@ class StampAnnotation : public Annotation
  *
  * Annotation representing an ink path on a page.
  */
-class InkAnnotation : public Annotation
+class POPPLER_QT4_EXPORT InkAnnotation : public Annotation
 {
   public:
     InkAnnotation();
@@ -472,7 +473,7 @@ class InkAnnotation : public Annotation
     Q_DISABLE_COPY( InkAnnotation )
 };
 
-class LinkAnnotation : public Annotation
+class POPPLER_QT4_EXPORT LinkAnnotation : public Annotation
 {
   public:
     LinkAnnotation();
diff --git a/qt4/src/poppler-converter-private.h b/qt4/src/poppler-converter-private.h
index 051d9eb..e1cf080 100644
--- a/qt4/src/poppler-converter-private.h
+++ b/qt4/src/poppler-converter-private.h
@@ -21,6 +21,7 @@
 #define POPPLER_QT4_CONVERTER_PRIVATE_H
 
 #include <QtCore/QString>
+#include "poppler-export.h"
 
 class QIODevice;
 
diff --git a/qt4/src/poppler-export.h b/qt4/src/poppler-export.h
index 28827bd..fb92520 100644
--- a/qt4/src/poppler-export.h
+++ b/qt4/src/poppler-export.h
@@ -10,8 +10,8 @@
 # define LIB_IMPORT
 #endif
 
-#ifdef poppler_qt4_EXPORTS
-# define poppler_qt4_EXPORT LIB_EXPORT
+#ifdef POPPLER_QT4_EXPORTS
+# define POPPLER_QT4_EXPORT LIB_EXPORT
 #else
-# define poppler_qt4_EXPORT LIB_IMPORT
+# define POPPLER_QT4_EXPORT LIB_IMPORT
 #endif
diff --git a/qt4/src/poppler-form.h b/qt4/src/poppler-form.h
index fa3317d..e8afff9 100644
--- a/qt4/src/poppler-form.h
+++ b/qt4/src/poppler-form.h
@@ -21,6 +21,7 @@
 
 #include <QtCore/QRectF>
 #include <QtCore/QStringList>
+#include "poppler-export.h"
 
 class Page;
 class FormWidget;
@@ -36,7 +37,7 @@ namespace Poppler {
     /**
       The base class representing a form field.
      */
-    class FormField {
+    class POPPLER_QT4_EXPORT FormField {
     public:
 
 	/**
@@ -102,7 +103,7 @@ namespace Poppler {
     /**
       A form field that represents a "button".
      */
-    class FormFieldButton : public FormField {
+    class POPPLER_QT4_EXPORT FormFieldButton : public FormField {
     public:
 
 	/**
@@ -157,7 +158,7 @@ namespace Poppler {
     /**
       A form field that represents a text input.
      */
-    class FormFieldText : public FormField {
+    class POPPLER_QT4_EXPORT FormFieldText : public FormField {
     public:
 
 	/**
@@ -228,7 +229,7 @@ namespace Poppler {
     /**
       A form field that represents a choice field.
      */
-    class FormFieldChoice : public FormField {
+    class POPPLER_QT4_EXPORT FormFieldChoice : public FormField {
     public:
 
 	/**
diff --git a/qt4/src/poppler-link-extractor-private.h b/qt4/src/poppler-link-extractor-private.h
index 03d93e0..3cdb20a 100644
--- a/qt4/src/poppler-link-extractor-private.h
+++ b/qt4/src/poppler-link-extractor-private.h
@@ -23,6 +23,7 @@
 #include <OutputDev.h>
 
 #include <QtCore/QList>
+#include "poppler-export.h"
 
 namespace Poppler
 {
diff --git a/qt4/src/poppler-link.h b/qt4/src/poppler-link.h
index 7c6e60b..a7a066c 100644
--- a/qt4/src/poppler-link.h
+++ b/qt4/src/poppler-link.h
@@ -24,6 +24,7 @@
 #include <QtCore/QString>
 #include <QtCore/QRectF>
 #include <QtCore/QSharedDataPointer>
+#include "poppler-export.h"
 
 namespace Poppler {
 
@@ -43,7 +44,7 @@ class SoundObject;
  *
  * Coordinates are in 0..1 range
  */
-class LinkDestination
+class POPPLER_QT4_EXPORT LinkDestination
 {
 	public:
 		enum Kind
@@ -102,7 +103,7 @@ class LinkDestination
  * kind of links to reimplement the linkType() method and return the type of
  * the link described by the reimplemented class.
  */
-class Link
+class POPPLER_QT4_EXPORT Link
 {
 	public:
 		Link( const QRectF &linkArea );
@@ -155,7 +156,7 @@ class Link
 
 
 /** Goto: a viewport and maybe a reference to an external filename **/
-class LinkGoto : public Link
+class POPPLER_QT4_EXPORT LinkGoto : public Link
 {
 	public:
 		/**
@@ -187,7 +188,7 @@ class LinkGoto : public Link
 };
 
 /** Execute: filename and parameters to execute **/
-class LinkExecute : public Link
+class POPPLER_QT4_EXPORT LinkExecute : public Link
 {
 	public:
 		/**
@@ -216,7 +217,7 @@ class LinkExecute : public Link
 };
 
 /** Browse: an URL to open, ranging from 'http://' to 'mailto:', etc. **/
-class LinkBrowse : public Link
+class POPPLER_QT4_EXPORT LinkBrowse : public Link
 {
 	public:
 		/**
@@ -243,7 +244,7 @@ class LinkBrowse : public Link
 };	
 
 /** Action: contains an action to perform on document / viewer **/
-class LinkAction : public Link
+class POPPLER_QT4_EXPORT LinkAction : public Link
 {
 	public:
 		/**
@@ -287,7 +288,7 @@ class LinkAction : public Link
 };
 
 /** Sound: a sound to be played **/
-class LinkSound : public Link
+class POPPLER_QT4_EXPORT LinkSound : public Link
 {
 	public:
 		// create a Link_Sound
@@ -325,7 +326,7 @@ class LinkSound : public Link
 };
 
 /** Movie: Not yet defined -> think renaming to 'Media' link **/
-class LinkMovie : public Link
+class POPPLER_QT4_EXPORT LinkMovie : public Link
 // TODO this (Movie link)
 {
 	public:
diff --git a/qt4/src/poppler-page-private.h b/qt4/src/poppler-page-private.h
index dd79306..ef85527 100644
--- a/qt4/src/poppler-page-private.h
+++ b/qt4/src/poppler-page-private.h
@@ -18,6 +18,7 @@
 
 #ifndef _POPPLER_PAGE_PRIVATE_H_
 #define _POPPLER_PAGE_PRIVATE_H_
+#include "poppler-export.h"
 
 class QRectF;
 
diff --git a/qt4/src/poppler-private.h b/qt4/src/poppler-private.h
index 77cb431..bd8c8ff 100644
--- a/qt4/src/poppler-private.h
+++ b/qt4/src/poppler-private.h
@@ -38,6 +38,7 @@
 #if defined(HAVE_SPLASH)
 #include <SplashOutputDev.h>
 #endif
+#include "poppler-export.h"
 
 #include "poppler-qt4.h"
 
diff --git a/qt4/src/poppler-qiodeviceoutstream-private.h b/qt4/src/poppler-qiodeviceoutstream-private.h
index 74b56ca..0c24314 100644
--- a/qt4/src/poppler-qiodeviceoutstream-private.h
+++ b/qt4/src/poppler-qiodeviceoutstream-private.h
@@ -21,6 +21,7 @@
 
 #include "Object.h"
 #include "Stream.h"
+#include "poppler-export.h"
 
 class QIODevice;
 
diff --git a/qt4/src/poppler-qt4.h b/qt4/src/poppler-qt4.h
index 280607b..60945cb 100644
--- a/qt4/src/poppler-qt4.h
+++ b/qt4/src/poppler-qt4.h
@@ -28,6 +28,7 @@
 #include <QtCore/QDateTime>
 #include <QtCore/QSet>
 #include <QtXml/QDomDocument>
+#include "poppler-export.h"
 
 class EmbFile;
 class Sound;
@@ -58,7 +59,7 @@ namespace Poppler {
 	- a QRectF that gives a box that describes where on the page
 	the text is found.
     */
-    class TextBox {
+    class POPPLER_QT4_EXPORT TextBox {
     friend class Page;
     public:
       /**
@@ -101,7 +102,7 @@ namespace Poppler {
        Container class for information about a font within a PDF
        document
     */
-    class FontInfo {
+    class POPPLER_QT4_EXPORT FontInfo {
     public:
 	enum Type {
 		unknown,
@@ -192,7 +193,7 @@ namespace Poppler {
     /**
        Container class for an embedded file with a PDF document
     */
-    class EmbeddedFile {
+    class POPPLER_QT4_EXPORT EmbeddedFile {
     public:
 	/// \cond PRIVATE
 	EmbeddedFile(EmbFile *embfile);
@@ -259,7 +260,7 @@ namespace Poppler {
     /**
        Page within a PDF document
     */
-    class Page {
+    class POPPLER_QT4_EXPORT Page {
 	friend class Document;
     public:
 	/**
@@ -462,7 +463,7 @@ namespace Poppler {
 
    A document potentially contains multiple Pages
 */
-    class Document {
+    class POPPLER_QT4_EXPORT Document {
 	friend class Page;
 	friend class DocumentData;
   
@@ -884,7 +885,7 @@ QString subject = m_doc->info("Subject");
 
        This is the base class for the converters.
     */
-    class BaseConverter
+    class POPPLER_QT4_EXPORT BaseConverter
     {
         friend class Document;
         public:
@@ -931,7 +932,7 @@ width = dummy.width();
 height = dummy.height();
        \endcode
     */
-    class PSConverter : public BaseConverter
+    class POPPLER_QT4_EXPORT PSConverter : public BaseConverter
     {
         friend class Document;
         public:
@@ -1017,7 +1018,7 @@ height = dummy.height();
     /**
        Converts a PDF to PDF (thus saves a copy of the document).
     */
-    class PDFConverter : public BaseConverter
+    class POPPLER_QT4_EXPORT PDFConverter : public BaseConverter
     {
         friend class Document;
         public:
@@ -1052,7 +1053,7 @@ height = dummy.height();
     /**
        Conversion from PDF date string format to QDateTime
     */
-    QDateTime convertDate( char *dateString );
+    POPPLER_QT4_EXPORT QDateTime convertDate( char *dateString );
 
     class SoundData;
     /**
@@ -1062,7 +1063,7 @@ height = dummy.height();
        whose url is represented by url() ), or Embedded, and the player has to
        play the data contained in data().
     */
-    class SoundObject {
+    class POPPLER_QT4_EXPORT SoundObject {
     public:
 	/**
 	   The type of sound
diff --git a/qt4/tests/CMakeLists.txt b/qt4/tests/CMakeLists.txt
index b17da53..06dd988 100644
--- a/qt4/tests/CMakeLists.txt
+++ b/qt4/tests/CMakeLists.txt
@@ -15,6 +15,9 @@ macro(QT4_ADD_SIMPLETEST exe source)
   )
   poppler_add_test(${exe} BUILD_QT4_TESTS ${${test_name}_SOURCES})
   target_link_libraries(${exe} poppler-qt4)
+  if(MSVC)
+    target_link_libraries(${exe} poppler ${poppler_LIBS})
+  endif(MSVC)
 endmacro(QT4_ADD_SIMPLETEST)
 
 macro(QT4_ADD_QTEST exe source)
@@ -26,6 +29,9 @@ macro(QT4_ADD_QTEST exe source)
     poppler_add_unittest(${exe} BUILD_QT4_TESTS ${${test_name}_SOURCES})
     qt4_automoc(${${test_name}_SOURCES})
     target_link_libraries(${exe} poppler-qt4 ${QT4_QTTEST_LIBRARY})
+    if(MSVC)
+      target_link_libraries(${exe} poppler ${poppler_LIBS})
+    endif(MSVC)
   endif (QT4_QTTEST_FOUND)
 endmacro(QT4_ADD_QTEST)
 


More information about the poppler mailing list