Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add qgis_core.h to with CORE_EXPORT macro
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