Skip to content

Commit 0302719

Browse files
committed
Add qgis_core.h to with CORE_EXPORT macro
This removes complexity from the compiler flags because defines happen in a file.
1 parent ab77fee commit 0302719

File tree

144 files changed

+336
-100
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+336
-100
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -581,7 +581,6 @@ ELSE (WIN32)
581581

582582
ENDIF(WIN32)
583583

584-
ADD_DEFINITIONS("-DCORE_EXPORT=${DLLIMPORT}")
585584
ADD_DEFINITIONS("-DGUI_EXPORT=${DLLIMPORT}")
586585
ADD_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
587586
ADD_DEFINITIONS("-DANALYSIS_EXPORT=${DLLIMPORT}")
@@ -590,6 +589,7 @@ ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLIMPORT}")
590589
ADD_DEFINITIONS("-DSERVER_EXPORT=${DLLIMPORT}")
591590

592591
SET(CMAKE_CXX_VISIBILITY_PRESET hidden)
592+
INCLUDE(GenerateExportHeader)
593593

594594
#############################################################
595595
# user-changeable settings which can be used to customize

python/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ INCLUDE_DIRECTORIES(
120120
sip_helpers
121121

122122
${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
123+
${CMAKE_BINARY_DIR}/src/core
123124
)
124125

125126
IF(NOT ANDROID)

python/sip_helpers/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ INCLUDE_DIRECTORIES(SYSTEM
1717
)
1818

1919
INCLUDE_DIRECTORIES(
20-
${CMAKE_CURRENT_BINARY_DIR}/../core
20+
${CMAKE_BINARY_DIR}/python/core
21+
${CMAKE_BINARY_DIR}/src/core
2122
../../src/core
2223
../../src/core/auth
2324
../../src/core/pal

src/analysis/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ INCLUDE_DIRECTORIES(
162162
${CMAKE_CURRENT_SOURCE_DIR}/../core/geometry
163163
${CMAKE_CURRENT_SOURCE_DIR}/../core/raster
164164
${CMAKE_CURRENT_SOURCE_DIR}/../core/symbology-ng
165+
${CMAKE_BINARY_DIR}/src/core
165166
interpolation
166167
network
167168
)

src/app/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ INCLUDE_DIRECTORIES(
524524
${CMAKE_CURRENT_SOURCE_DIR} composer legend pluginmanager
525525
${CMAKE_CURRENT_BINARY_DIR}
526526
${CMAKE_CURRENT_BINARY_DIR}/../ui
527+
${CMAKE_BINARY_DIR}/src/core
527528
)
528529
INCLUDE_DIRECTORIES(SYSTEM
529530
${QWT_INCLUDE_DIR}

src/app/dwg/libdxfrw/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
INCLUDE_DIRECTORIES(
22
${CMAKE_SOURCE_DIR}/src/core
3+
${CMAKE_BINARY_DIR}/src/core
34
${Qt5Core_INCLUDE_DIRS}
45
)
56

src/auth/basic/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (
1919
../../core
2020
../../core/auth
2121
../../core/geometry
22+
${CMAKE_BINARY_DIR}/src/core
2223
)
2324
INCLUDE_DIRECTORIES (SYSTEM
2425
${QCA_INCLUDE_DIR}

src/auth/identcert/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (
1919
../../core
2020
../../core/auth
2121
../../core/geometry
22+
${CMAKE_BINARY_DIR}/src/core
2223
)
2324
INCLUDE_DIRECTORIES (SYSTEM
2425
${QCA_INCLUDE_DIR}

src/auth/pkipaths/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (
1919
../../core
2020
../../core/auth
2121
../../core/geometry
22+
${CMAKE_BINARY_DIR}/src/core
2223
)
2324
INCLUDE_DIRECTORIES (SYSTEM
2425
${QCA_INCLUDE_DIR}

src/auth/pkipkcs12/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (
1919
../../core
2020
../../core/auth
2121
../../core/geometry
22+
${CMAKE_BINARY_DIR}/src/core
2223
)
2324
INCLUDE_DIRECTORIES (SYSTEM
2425
${QCA_INCLUDE_DIR}

src/browser/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
6565
${CMAKE_CURRENT_SOURCE_DIR}/../gui/editorwidgets/core
6666
${CMAKE_CURRENT_BINARY_DIR}/../ui
6767
${CMAKE_CURRENT_BINARY_DIR}
68+
${CMAKE_BINARY_DIR}/src/core
6869
)
6970
INCLUDE_DIRECTORIES(SYSTEM
7071
${GEOS_INCLUDE_DIR}

src/core/CMakeLists.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,7 @@ ENDIF (QT_MOBILITY_LOCATION_FOUND OR Qt5Positioning_FOUND)
903903

904904
INCLUDE_DIRECTORIES(
905905
${CMAKE_CURRENT_SOURCE_DIR}
906+
${CMAKE_CURRENT_BINARY_DIR}
906907
auth
907908
composer
908909
dxf
@@ -927,10 +928,6 @@ INCLUDE_DIRECTORIES(SYSTEM
927928
${QCA_INCLUDE_DIR}
928929
)
929930

930-
REMOVE_DEFINITIONS("-DCORE_EXPORT=${DLLIMPORT}")
931-
ADD_DEFINITIONS("\"-DCORE_EXPORT=${DLLEXPORT}\"")
932-
933-
934931
#for PAL classes
935932
IF (WIN32)
936933
ADD_DEFINITIONS("-D_HAVE_WINDOWS_H_")
@@ -946,6 +943,14 @@ ADD_DEFINITIONS(-DTEST_DATA_DIR="\\"${TEST_DATA_DIR}\\"")
946943

947944
ADD_LIBRARY(qgis_core SHARED ${QGIS_CORE_SRCS} ${QGIS_CORE_MOC_SRCS} ${QGIS_CORE_HDRS} ${QGIS_CORE_MOC_HDRS})
948945

946+
GENERATE_EXPORT_HEADER(
947+
qgis_core
948+
BASE_NAME CORE
949+
EXPORT_FILE_NAME qgis_core.h
950+
)
951+
952+
SET(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} ${PROJECT_BINARY_DIR}/qgis_core.h)
953+
949954
IF(ENABLE_MODELTEST)
950955
TARGET_LINK_LIBRARIES(qgis_core ${QT_QTTEST_LIBRARY})
951956
ENDIF(ENABLE_MODELTEST)

src/core/auth/qgsauthcertutils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <QSslCertificate>
2424
#include <QSslError>
2525

26+
#include "qgis_core.h"
27+
2628
class QgsAuthConfigSslServer;
2729

2830
#define SSL_ISSUER_INFO( var, prop ) var.issuerInfo( prop ).value(0)

src/core/auth/qgsauthcrypto.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <QFile>
2121
#include <QString>
2222

23+
#include "qgis_core.h"
24+
2325
/** \ingroup core
2426
* Funtions for hashing/checking master password and encrypt/decrypting data with password
2527
* \since 2.8

src/core/auth/qgsauthmethod.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <QStringList>
2525
#include <QUrl>
2626

27+
#include "qgis_core.h"
28+
2729
class QgsAuthMethodConfig;
2830

2931
/** \ingroup core

src/core/auth/qgsauthmethodmetadata.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919

2020
#include <QString>
2121

22+
#include "qgis_core.h"
23+
2224
/** \ingroup core
2325
* Holds data auth method key, description, and associated shared library file information.
2426

src/core/auth/qgsauthmethodregistry.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <QMap>
2323
#include <QString>
2424

25+
#include "qgis_core.h"
26+
2527
class QgsAuthMethod;
2628
class QgsAuthMethodMetadata;
2729

src/core/composer/qgsaddremoveitemcommand.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@
1919
#define QGSADDREMOVEITEMCOMMAND_H
2020

2121
#include <QUndoCommand>
22+
23+
#include "qgis_core.h"
24+
2225
class QgsComposerItem;
2326
class QgsComposition;
2427

src/core/composer/qgsaddremovemultiframecommand.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include <QUndoCommand>
2222

23+
#include "qgis_core.h"
24+
2325
class QgsComposerMultiFrame;
2426
class QgsComposition;
2527

src/core/composer/qgscomposerattributetablemodelv2.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <QAbstractTableModel>
2222
#include <QSortFilterProxyModel>
2323

24+
#include "qgis_core.h"
25+
2426
class QgsComposerAttributeTableV2;
2527
class QgsComposerTableColumn;
2628

src/core/composer/qgscomposereffect.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <QGraphicsEffect>
2222
#include <QPainter>
2323

24+
#include "qgis_core.h"
25+
2426
/** \ingroup core
2527
* \class QgsComposerEffect
2628
*/

src/core/composer/qgscomposeritemcommand.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <QUndoCommand>
2222
#include <QDomDocument>
2323

24+
#include "qgis_core.h"
25+
2426
class QgsComposerItem;
2527
class QgsComposerMultiFrame;
2628

src/core/composer/qgscomposermousehandles.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <QGraphicsRectItem>
2121
#include <QObject>
2222

23+
#include "qgis_core.h"
24+
2325
class QgsComposition;
2426
class QgsComposerItem;
2527
class QGraphicsView;

src/core/composer/qgscomposermultiframecommand.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <QUndoCommand>
2222
#include <QDomDocument>
2323

24+
#include "qgis_core.h"
25+
2426
class QgsComposerMultiFrame;
2527

2628
/** \ingroup core

src/core/composer/qgscomposertablecolumn.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <QDomElement>
2424
#include <QColor>
2525

26+
#include "qgis_core.h"
27+
2628
/** \ingroup core
2729
* Stores properties of a column in a QgsComposerTable. Some properties of a QgsComposerTableColumn
2830
are applicable only in certain contexts. For instance, the attribute and setAttribute methods only

src/core/composer/qgsscalebarstyle.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include <QIcon>
2121
#include <QRectF>
2222

23+
#include "qgis_core.h"
24+
2325
class QgsComposerScaleBar;
2426
class QPainter;
2527

src/core/dxf/qgsdxfpaintdevice.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include <QPaintDevice>
2222

23+
#include "qgis_core.h"
24+
2325
class QgsDxfPaintEngine;
2426
class QgsDxfExport;
2527
class QPaintEngine;

src/core/effects/qgsimageoperation.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <QColor>
2323
#include <QtCore/qmath.h>
2424

25+
#include "qgis_core.h"
26+
2527
class QgsColorRamp;
2628

2729
/** \ingroup core

src/core/geometry/qgswkbtypes.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <QMap>
2222
#include <QString>
2323

24+
#include "qgis_core.h"
25+
2426
/***************************************************************************
2527
* This class is considered CRITICAL and any change MUST be accompanied with
2628
* full unit tests in testqgsstatisticalsummary.cpp.

src/core/gps/qgsgpsconnection.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
#include <QObject>
2323
#include <QString>
2424

25+
#include "qgis_core.h"
26+
2527
class QIODevice;
2628

2729
struct CORE_EXPORT QgsSatelliteInfo

src/core/gps/qgsgpsconnectionregistry.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <QList>
2222
#include <QSet>
2323

24+
#include "qgis_core.h"
25+
2426
class QgsGPSConnection;
2527

2628
/** \ingroup core

src/core/gps/qgsgpsdetector.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <QList>
2323
#include <QPair>
2424

25+
#include "qgis_core.h"
2526
#include "qextserialport.h"
2627

2728
class QgsGPSConnection;

src/core/layertree/qgslayertreeregistrybridge.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
#include <QObject>
2020
#include <QStringList>
2121

22+
#include "qgis_core.h"
23+
2224
class QgsLayerTreeGroup;
2325
class QgsLayerTreeNode;
2426
class QgsMapLayer;

src/core/layertree/qgslayertreeutils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <qnamespace.h>
2020
#include <QList>
2121
#include <QPair>
22+
#include "qgis_core.h"
2223

2324
class QDomElement;
2425
class QDomDocument;

src/core/pal/pointset.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#include <QLinkedList>
3636
#include <geos_c.h>
3737

38+
#include "qgis_core.h"
39+
3840
namespace pal
3941
{
4042

src/core/qgis.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@
3232
#include <cmath>
3333
#include <qnumeric.h>
3434

35-
#include <qgswkbtypes.h>
35+
#include "qgswkbtypes.h"
36+
#include "qgis_core.h"
3637

3738
/** \ingroup core
3839
* The Qgis class provides global constants for use throughout the application.

src/core/qgsattributetableconfig.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
#include <QDomNode>
2222
#include <QVariant>
2323

24+
#include "qgis_core.h"
25+
2426
class QgsFields;
2527

2628
/** \ingroup core

src/core/qgsbearingutils.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
class QgsCoordinateReferenceSystem;
2222
class QgsPoint;
2323

24+
#include "qgis_core.h"
2425

2526
/**
2627
* \class QgsBearingUtils

src/core/qgscolorscheme.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <QPair>
2424
#include <QObject>
2525

26+
#include "qgis_core.h"
27+
2628
/** \ingroup core
2729
* List of colors paired with a friendly display name identifying the color
2830
* \note Added in version 2.5

src/core/qgscontexthelp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <QHash>
2424
#include <QProcess>
2525

26+
#include "qgis_core.h"
27+
2628
/** \ingroup core
2729
* Provides a context based help browser for a dialog.
2830
*

src/core/qgscoordinateutils.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020

2121
#include <QString>
2222

23+
#include "qgis_core.h"
24+
2325
class QgsPoint;
2426
class QgsCoordinateReferenceSystem;
2527

src/core/qgscredentials.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
#include <QMap>
2424
#include <QMutex>
2525

26+
#include "qgis_core.h"
27+
2628
/** \ingroup core
2729
* Interface for requesting credentials in QGIS in GUI independent way.
2830
* This class provides abstraction of a dialog for requesting credentials to the user.

0 commit comments

Comments
 (0)