Navigation Menu

Skip to content

Commit

Permalink
Add qgis_core.h to with CORE_EXPORT macro
Browse files Browse the repository at this point in the history
This removes complexity from the compiler flags because defines
happen in a file.
  • Loading branch information
m-kuhn committed Jan 4, 2017
1 parent ab77fee commit 0302719
Show file tree
Hide file tree
Showing 144 changed files with 336 additions and 100 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -581,7 +581,6 @@ ELSE (WIN32)

ENDIF(WIN32)

ADD_DEFINITIONS("-DCORE_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DGUI_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DANALYSIS_EXPORT=${DLLIMPORT}")
Expand All @@ -590,6 +589,7 @@ ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DSERVER_EXPORT=${DLLIMPORT}")

SET(CMAKE_CXX_VISIBILITY_PRESET hidden)
INCLUDE(GenerateExportHeader)

#############################################################
# user-changeable settings which can be used to customize
Expand Down
1 change: 1 addition & 0 deletions python/CMakeLists.txt
Expand Up @@ -120,6 +120,7 @@ INCLUDE_DIRECTORIES(
sip_helpers

${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
${CMAKE_BINARY_DIR}/src/core
)

IF(NOT ANDROID)
Expand Down
3 changes: 2 additions & 1 deletion python/sip_helpers/CMakeLists.txt
Expand Up @@ -17,7 +17,8 @@ INCLUDE_DIRECTORIES(SYSTEM
)

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}/../core
${CMAKE_BINARY_DIR}/python/core
${CMAKE_BINARY_DIR}/src/core
../../src/core
../../src/core/auth
../../src/core/pal
Expand Down
1 change: 1 addition & 0 deletions src/analysis/CMakeLists.txt
Expand Up @@ -162,6 +162,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/../core/geometry
${CMAKE_CURRENT_SOURCE_DIR}/../core/raster
${CMAKE_CURRENT_SOURCE_DIR}/../core/symbology-ng
${CMAKE_BINARY_DIR}/src/core
interpolation
network
)
Expand Down
1 change: 1 addition & 0 deletions src/app/CMakeLists.txt
Expand Up @@ -524,6 +524,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR} composer legend pluginmanager
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_BINARY_DIR}/../ui
${CMAKE_BINARY_DIR}/src/core
)
INCLUDE_DIRECTORIES(SYSTEM
${QWT_INCLUDE_DIR}
Expand Down
1 change: 1 addition & 0 deletions src/app/dwg/libdxfrw/CMakeLists.txt
@@ -1,5 +1,6 @@
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/core
${CMAKE_BINARY_DIR}/src/core
${Qt5Core_INCLUDE_DIRS}
)

Expand Down
1 change: 1 addition & 0 deletions src/auth/basic/CMakeLists.txt
Expand Up @@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (
../../core
../../core/auth
../../core/geometry
${CMAKE_BINARY_DIR}/src/core
)
INCLUDE_DIRECTORIES (SYSTEM
${QCA_INCLUDE_DIR}
Expand Down
1 change: 1 addition & 0 deletions src/auth/identcert/CMakeLists.txt
Expand Up @@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (
../../core
../../core/auth
../../core/geometry
${CMAKE_BINARY_DIR}/src/core
)
INCLUDE_DIRECTORIES (SYSTEM
${QCA_INCLUDE_DIR}
Expand Down
1 change: 1 addition & 0 deletions src/auth/pkipaths/CMakeLists.txt
Expand Up @@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (
../../core
../../core/auth
../../core/geometry
${CMAKE_BINARY_DIR}/src/core
)
INCLUDE_DIRECTORIES (SYSTEM
${QCA_INCLUDE_DIR}
Expand Down
1 change: 1 addition & 0 deletions src/auth/pkipkcs12/CMakeLists.txt
Expand Up @@ -19,6 +19,7 @@ INCLUDE_DIRECTORIES (
../../core
../../core/auth
../../core/geometry
${CMAKE_BINARY_DIR}/src/core
)
INCLUDE_DIRECTORIES (SYSTEM
${QCA_INCLUDE_DIR}
Expand Down
1 change: 1 addition & 0 deletions src/browser/CMakeLists.txt
Expand Up @@ -65,6 +65,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/../gui/editorwidgets/core
${CMAKE_CURRENT_BINARY_DIR}/../ui
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/src/core
)
INCLUDE_DIRECTORIES(SYSTEM
${GEOS_INCLUDE_DIR}
Expand Down
13 changes: 9 additions & 4 deletions src/core/CMakeLists.txt
Expand Up @@ -903,6 +903,7 @@ ENDIF (QT_MOBILITY_LOCATION_FOUND OR Qt5Positioning_FOUND)

INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
auth
composer
dxf
Expand All @@ -927,10 +928,6 @@ INCLUDE_DIRECTORIES(SYSTEM
${QCA_INCLUDE_DIR}
)

REMOVE_DEFINITIONS("-DCORE_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("\"-DCORE_EXPORT=${DLLEXPORT}\"")


#for PAL classes
IF (WIN32)
ADD_DEFINITIONS("-D_HAVE_WINDOWS_H_")
Expand All @@ -946,6 +943,14 @@ ADD_DEFINITIONS(-DTEST_DATA_DIR="\\"${TEST_DATA_DIR}\\"")

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

GENERATE_EXPORT_HEADER(
qgis_core
BASE_NAME CORE
EXPORT_FILE_NAME qgis_core.h
)

SET(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} ${PROJECT_BINARY_DIR}/qgis_core.h)

IF(ENABLE_MODELTEST)
TARGET_LINK_LIBRARIES(qgis_core ${QT_QTTEST_LIBRARY})
ENDIF(ENABLE_MODELTEST)
Expand Down
2 changes: 2 additions & 0 deletions src/core/auth/qgsauthcertutils.h
Expand Up @@ -23,6 +23,8 @@
#include <QSslCertificate>
#include <QSslError>

#include "qgis_core.h"

class QgsAuthConfigSslServer;

#define SSL_ISSUER_INFO( var, prop ) var.issuerInfo( prop ).value(0)
Expand Down
2 changes: 2 additions & 0 deletions src/core/auth/qgsauthcrypto.h
Expand Up @@ -20,6 +20,8 @@
#include <QFile>
#include <QString>

#include "qgis_core.h"

/** \ingroup core
* Funtions for hashing/checking master password and encrypt/decrypting data with password
* \since 2.8
Expand Down
2 changes: 2 additions & 0 deletions src/core/auth/qgsauthmethod.h
Expand Up @@ -24,6 +24,8 @@
#include <QStringList>
#include <QUrl>

#include "qgis_core.h"

class QgsAuthMethodConfig;

/** \ingroup core
Expand Down
2 changes: 2 additions & 0 deletions src/core/auth/qgsauthmethodmetadata.h
Expand Up @@ -19,6 +19,8 @@

#include <QString>

#include "qgis_core.h"

/** \ingroup core
* Holds data auth method key, description, and associated shared library file information.
Expand Down
2 changes: 2 additions & 0 deletions src/core/auth/qgsauthmethodregistry.h
Expand Up @@ -22,6 +22,8 @@
#include <QMap>
#include <QString>

#include "qgis_core.h"

class QgsAuthMethod;
class QgsAuthMethodMetadata;

Expand Down
3 changes: 3 additions & 0 deletions src/core/composer/qgsaddremoveitemcommand.h
Expand Up @@ -19,6 +19,9 @@
#define QGSADDREMOVEITEMCOMMAND_H

#include <QUndoCommand>

#include "qgis_core.h"

class QgsComposerItem;
class QgsComposition;

Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgsaddremovemultiframecommand.h
Expand Up @@ -20,6 +20,8 @@

#include <QUndoCommand>

#include "qgis_core.h"

class QgsComposerMultiFrame;
class QgsComposition;

Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposerattributetablemodelv2.h
Expand Up @@ -21,6 +21,8 @@
#include <QAbstractTableModel>
#include <QSortFilterProxyModel>

#include "qgis_core.h"

class QgsComposerAttributeTableV2;
class QgsComposerTableColumn;

Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposereffect.h
Expand Up @@ -21,6 +21,8 @@
#include <QGraphicsEffect>
#include <QPainter>

#include "qgis_core.h"

/** \ingroup core
* \class QgsComposerEffect
*/
Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposeritemcommand.h
Expand Up @@ -21,6 +21,8 @@
#include <QUndoCommand>
#include <QDomDocument>

#include "qgis_core.h"

class QgsComposerItem;
class QgsComposerMultiFrame;

Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposermousehandles.h
Expand Up @@ -20,6 +20,8 @@
#include <QGraphicsRectItem>
#include <QObject>

#include "qgis_core.h"

class QgsComposition;
class QgsComposerItem;
class QGraphicsView;
Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposermultiframecommand.h
Expand Up @@ -21,6 +21,8 @@
#include <QUndoCommand>
#include <QDomDocument>

#include "qgis_core.h"

class QgsComposerMultiFrame;

/** \ingroup core
Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgscomposertablecolumn.h
Expand Up @@ -23,6 +23,8 @@
#include <QDomElement>
#include <QColor>

#include "qgis_core.h"

/** \ingroup core
* Stores properties of a column in a QgsComposerTable. Some properties of a QgsComposerTableColumn
are applicable only in certain contexts. For instance, the attribute and setAttribute methods only
Expand Down
2 changes: 2 additions & 0 deletions src/core/composer/qgsscalebarstyle.h
Expand Up @@ -20,6 +20,8 @@
#include <QIcon>
#include <QRectF>

#include "qgis_core.h"

class QgsComposerScaleBar;
class QPainter;

Expand Down
2 changes: 2 additions & 0 deletions src/core/dxf/qgsdxfpaintdevice.h
Expand Up @@ -20,6 +20,8 @@

#include <QPaintDevice>

#include "qgis_core.h"

class QgsDxfPaintEngine;
class QgsDxfExport;
class QPaintEngine;
Expand Down
2 changes: 2 additions & 0 deletions src/core/effects/qgsimageoperation.h
Expand Up @@ -22,6 +22,8 @@
#include <QColor>
#include <QtCore/qmath.h>

#include "qgis_core.h"

class QgsColorRamp;

/** \ingroup core
Expand Down
2 changes: 2 additions & 0 deletions src/core/geometry/qgswkbtypes.h
Expand Up @@ -21,6 +21,8 @@
#include <QMap>
#include <QString>

#include "qgis_core.h"

/***************************************************************************
* This class is considered CRITICAL and any change MUST be accompanied with
* full unit tests in testqgsstatisticalsummary.cpp.
Expand Down
2 changes: 2 additions & 0 deletions src/core/gps/qgsgpsconnection.h
Expand Up @@ -22,6 +22,8 @@
#include <QObject>
#include <QString>

#include "qgis_core.h"

class QIODevice;

struct CORE_EXPORT QgsSatelliteInfo
Expand Down
2 changes: 2 additions & 0 deletions src/core/gps/qgsgpsconnectionregistry.h
Expand Up @@ -21,6 +21,8 @@
#include <QList>
#include <QSet>

#include "qgis_core.h"

class QgsGPSConnection;

/** \ingroup core
Expand Down
1 change: 1 addition & 0 deletions src/core/gps/qgsgpsdetector.h
Expand Up @@ -22,6 +22,7 @@
#include <QList>
#include <QPair>

#include "qgis_core.h"
#include "qextserialport.h"

class QgsGPSConnection;
Expand Down
2 changes: 2 additions & 0 deletions src/core/layertree/qgslayertreeregistrybridge.h
Expand Up @@ -19,6 +19,8 @@
#include <QObject>
#include <QStringList>

#include "qgis_core.h"

class QgsLayerTreeGroup;
class QgsLayerTreeNode;
class QgsMapLayer;
Expand Down
1 change: 1 addition & 0 deletions src/core/layertree/qgslayertreeutils.h
Expand Up @@ -19,6 +19,7 @@
#include <qnamespace.h>
#include <QList>
#include <QPair>
#include "qgis_core.h"

class QDomElement;
class QDomDocument;
Expand Down
2 changes: 2 additions & 0 deletions src/core/pal/pointset.h
Expand Up @@ -35,6 +35,8 @@
#include <QLinkedList>
#include <geos_c.h>

#include "qgis_core.h"

namespace pal
{

Expand Down
3 changes: 2 additions & 1 deletion src/core/qgis.h
Expand Up @@ -32,7 +32,8 @@
#include <cmath>
#include <qnumeric.h>

#include <qgswkbtypes.h>
#include "qgswkbtypes.h"
#include "qgis_core.h"

/** \ingroup core
* The Qgis class provides global constants for use throughout the application.
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgsattributetableconfig.h
Expand Up @@ -21,6 +21,8 @@
#include <QDomNode>
#include <QVariant>

#include "qgis_core.h"

class QgsFields;

/** \ingroup core
Expand Down
1 change: 1 addition & 0 deletions src/core/qgsbearingutils.h
Expand Up @@ -21,6 +21,7 @@
class QgsCoordinateReferenceSystem;
class QgsPoint;

#include "qgis_core.h"

/**
* \class QgsBearingUtils
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgscolorscheme.h
Expand Up @@ -23,6 +23,8 @@
#include <QPair>
#include <QObject>

#include "qgis_core.h"

/** \ingroup core
* List of colors paired with a friendly display name identifying the color
* \note Added in version 2.5
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgscontexthelp.h
Expand Up @@ -23,6 +23,8 @@
#include <QHash>
#include <QProcess>

#include "qgis_core.h"

/** \ingroup core
* Provides a context based help browser for a dialog.
*
Expand Down
2 changes: 2 additions & 0 deletions src/core/qgscoordinateutils.h
Expand Up @@ -20,6 +20,8 @@

#include <QString>

#include "qgis_core.h"

class QgsPoint;
class QgsCoordinateReferenceSystem;

Expand Down
2 changes: 2 additions & 0 deletions src/core/qgscredentials.h
Expand Up @@ -23,6 +23,8 @@
#include <QMap>
#include <QMutex>

#include "qgis_core.h"

/** \ingroup core
* Interface for requesting credentials in QGIS in GUI independent way.
* This class provides abstraction of a dialog for requesting credentials to the user.
Expand Down

4 comments on commit 0302719

@nirvn
Copy link
Contributor

@nirvn nirvn commented on 0302719 Jan 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-kuhn the make install command is broken, throws the following error:

CMake Error at src/core/cmake_install.cmake:36 (file):
  file INSTALL cannot find "/home/webmaster/dev/cpp/QGIS/bm-qt5/qgis_core.h".
Call Stack (most recent call first):
  src/cmake_install.cmake:37 (include)
  cmake_install.cmake:56 (include)

@m-kuhn
Copy link
Member Author

@m-kuhn m-kuhn commented on 0302719 Jan 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, no computer with build env in reach at the moment

If you want you can try to change the line below the GENERATE_EXPORT_HEADER instruction to:

SET(QGIS_CORE_HDRS ${QGIS_CORE_HDRS} ${CMAKE_CURRENT_BINARY_DIR}/qgis_core.h)

(will need to be done for all modules)

@haubourg
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@m-kuhn same here qgis_core.h missing

@m-kuhn
Copy link
Member Author

@m-kuhn m-kuhn commented on 0302719 Jan 5, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be fixed now

Please sign in to comment.