Skip to content
Permalink
Browse files

Use qgis_grass_lib.h import for GRASS_LIB_EXPORT macro

  • Loading branch information
m-kuhn committed Jan 4, 2017
1 parent 6c1677d commit 8b9857079a5c8c528c4aaeacc7a8a7c75f2ec9e3
@@ -5,7 +5,6 @@ ADD_SUBDIRECTORY(scripts)
if (HAVE_OPENPTY)
ADD_DEFINITIONS(-DHAVE_OPENPTY)
ENDIF (HAVE_OPENPTY)
ADD_DEFINITIONS("-DGRASS_EXPORT=${DLLIMPORT} -DGRASS_LIB_EXPORT=${DLLIMPORT}")

IF (WIN32)
ADD_DEFINITIONS(-DHAVE_GETPT)
@@ -165,6 +164,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}/../../ui
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/app
)
INCLUDE_DIRECTORIES(SYSTEM
${GDAL_INCLUDE_DIR}
@@ -184,6 +184,10 @@ MACRO(ADD_GRASSPLUGIN GRASS_BUILD_VERSION)
QT5_WRAP_CPP (GRASS_PLUGIN_MOC_SRCS ${GRASS_PLUGIN_MOC_HDRS})
QT5_ADD_RESOURCES(GRASS_PLUGIN_RCC_SRCS ${GRASS_PLUGIN_RCCS})

INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/src/providers/grass/${GRASS_BUILD_VERSION}
)

ADD_LIBRARY (grassplugin${GRASS_BUILD_VERSION} MODULE
${GRASS_PLUGIN_SRCS}
${GRASS_PLUGIN_MOC_SRCS}
@@ -10,6 +10,7 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/gui
${CMAKE_BINARY_DIR}/src/providers/grass
)
INCLUDE_DIRECTORIES (SYSTEM
${GDAL_INCLUDE_DIR}
@@ -96,7 +97,7 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/mac/framework.info.plist.in"
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${COMPLETE_VERSION}
MACOSX_FRAMEWORK_IDENTIFIER org.qgis.qgis3_grass
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLEXPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\" ${GRASS_OFF_T_SIZE_DEF}"
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" ${GRASS_OFF_T_SIZE_DEF}"
)

IF (APPLE)
@@ -144,14 +145,20 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
SET_TARGET_PROPERTIES(qgisgrass${GRASS_BUILD_VERSION} PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
ENDIF (APPLE)

GENERATE_EXPORT_HEADER(
qgisgrass${GRASS_BUILD_VERSION}
BASE_NAME GRASS_LIB
EXPORT_FILE_NAME qgis_grass_lib.h
)

#
# GRASS vector provider
#
SET (GRASS_VECTOR_PROVIDER_SRCS ../qgsgrassprovidermodule.cpp)
QT5_WRAP_CPP(GRASS_VECTOR_PROVIDER_MOC_SRCS ../qgsgrassprovidermodule.h)
ADD_LIBRARY(grassprovider${GRASS_BUILD_VERSION} MODULE ${GRASS_VECTOR_PROVIDER_SRCS} ${GRASS_VECTOR_PROVIDER_MOC_SRCS})
SET_TARGET_PROPERTIES(grassprovider${GRASS_BUILD_VERSION} PROPERTIES
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_EXPORT=${DLLEXPORT}\" \"-DGRASS_LIB_EXPORT=${DLLIMPORT}\""
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\""
)
TARGET_LINK_LIBRARIES(grassprovider${GRASS_BUILD_VERSION}
qgisgrass${GRASS_BUILD_VERSION}
@@ -166,7 +173,7 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
)
ADD_LIBRARY(grassrasterprovider${GRASS_BUILD_VERSION} MODULE ${GRASS_RASTER_PROVIDER_SRCS})
SET_TARGET_PROPERTIES(grassrasterprovider${GRASS_BUILD_VERSION} PROPERTIES
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_EXPORT=${DLLEXPORT}\" \"-DGRASS_LIB_EXPORT=${DLLIMPORT}\""
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\""
)
TARGET_LINK_LIBRARIES(grassrasterprovider${GRASS_BUILD_VERSION}
qgisgrass${GRASS_BUILD_VERSION}
@@ -225,7 +232,7 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
#
ADD_EXECUTABLE(qgis.r.in${GRASS_BUILD_VERSION} ../qgis.r.in.cpp)
SET_TARGET_PROPERTIES(qgis.r.in${GRASS_BUILD_VERSION} PROPERTIES
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLIMPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\""
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\""
)
IF (GRASS_MAJOR_VERSION LESS 7 )
TARGET_LINK_LIBRARIES(qgis.r.in${GRASS_BUILD_VERSION}
@@ -251,7 +258,7 @@ MACRO(ADD_GRASSLIB GRASS_BUILD_VERSION)
#
ADD_EXECUTABLE(qgis.v.in${GRASS_BUILD_VERSION} ../qgis.v.in.cpp)
SET_TARGET_PROPERTIES(qgis.v.in${GRASS_BUILD_VERSION} PROPERTIES
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" \"-DGRASS_LIB_EXPORT=${DLLIMPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\""
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\""
)
TARGET_LINK_LIBRARIES(qgis.v.in${GRASS_BUILD_VERSION}
qgisgrass${GRASS_BUILD_VERSION}
@@ -760,7 +767,7 @@ IF(WITH_GRASS_DIRECT)
# in different directory
SET_TARGET_PROPERTIES(${FAKE_LIB_GRASS_GIS} PROPERTIES
CLEAN_DIRECT_OUTPUT 1
COMPILE_FLAGS "\"-DGRASS_LIB_EXPORT=${DLLEXPORT}\" \"-DGRASS_EXPORT=${DLLIMPORT}\" -DGRASS_VERSION=\\\"${GRASS_VERSION}\\\" -DGRASS_LIBRARY_GIS=\\\"${GRASS_LIBRARY_gis}\\\" \"-I${CMAKE_CURRENT_SOURCE_DIR}\" ")
COMPILE_FLAGS "-DGRASS_VERSION=\\\"${GRASS_VERSION}\\\" -DGRASS_LIBRARY_GIS=\\\"${GRASS_LIBRARY_gis}\\\" \"-I${CMAKE_CURRENT_SOURCE_DIR}\" ")

IF (NOT APPLE)
SET_TARGET_PROPERTIES(${FAKE_LIB_GRASS_GIS} PROPERTIES
@@ -773,6 +780,7 @@ IF(WITH_GRASS_DIRECT)
qgis_core
)


INSTALL(TARGETS ${FAKE_LIB_GRASS_GIS}
RUNTIME DESTINATION ${QGIS_PLUGIN_DIR}
LIBRARY DESTINATION ${QGIS_PLUGIN_DIR})
@@ -43,6 +43,7 @@ extern "C"
#include <QHash>
#include <QRegExp>
#include <QTemporaryFile>
#include "qgis_grass_lib.h"
class QgsCoordinateReferenceSystem;
class QgsRectangle;

@@ -18,6 +18,7 @@
#define QGSGRASSDATAFILE_H

#include <QFile>
#include "qgis_grass_lib.h"

/*
* This class does blocking reading which is necessary for QgsDataFile.
@@ -21,6 +21,7 @@
#include "qgsoptionsdialogbase.h"

#include "ui_qgsgrassoptionsbase.h"
#include "qgis_grass_lib.h"

class GRASS_LIB_EXPORT QgsGrassOptions : public QgsOptionsDialogBase, private Ui::QgsGrassOptionsBase
{
@@ -24,6 +24,7 @@
#include "qgsrasterdataprovider.h"
#include "qgsrectangle.h"
#include "qgscolorrampshader.h"
#include "qgis_grass_lib.h"

extern "C"
{
@@ -16,6 +16,8 @@
#ifndef QGSGRASSUNDOCOMMAND_H
#define QGSGRASSUNDOCOMMAND_H

#include "qgis_grass_lib.h"

class QgsGrassProvider;

class GRASS_LIB_EXPORT QgsGrassUndoCommand
@@ -24,6 +24,7 @@

#include "qgsfields.h"
#include "qgsfeature.h"
#include "qgis_grass_lib.h"

extern "C"
{
@@ -17,6 +17,8 @@
#ifndef QGSGRASSWIN_H
#define QGSGRASSWIN_H

#include "qgis_grass_lib.h"

// Windows utils
class GRASS_LIB_EXPORT QgsGrassWin
{
@@ -16,6 +16,10 @@ MACRO (ADD_QGIS_GRASS_TEST grass_build_version testname testsrc)
ADD_CUSTOM_TARGET(qgis_${testname}${grass_build_version}moc ALL DEPENDS ${qgis_${testname}${grass_build_version}_MOC_SRCS})
ADD_EXECUTABLE(qgis_${testname}${grass_build_version} ${qgis_${testname}${grass_build_version}_SRCS})

INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/src/providers/grass/${grass_build_version}
)

SET_TARGET_PROPERTIES(qgis_${testname}${grass_build_version} PROPERTIES
AUTOMOC TRUE
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX${grass_build_version}}\\\" \"-DGRASS_BUILD_VERSION=${grass_build_version}\""

0 comments on commit 8b98570

Please sign in to comment.
You can’t perform that action at this time.