Skip to content
Permalink
Browse files
fix customwidgets build on windows
  • Loading branch information
jef-n committed May 19, 2014
1 parent d522059 commit 7127e58974c3fa16a61d673a2b6ce36e54e308cd
@@ -509,6 +509,7 @@ ADD_DEFINITIONS("-DGUI_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DANALYSIS_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DAPP_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLIMPORT}")

#############################################################
# user-changeable settings which can be used to customize
@@ -535,7 +536,6 @@ SET (QGIS_LIBEXEC_DIR ${QGIS_LIBEXEC_SUBDIR})
SET (QGIS_DATA_DIR ${QGIS_DATA_SUBDIR})
SET (QGIS_PLUGIN_DIR ${QGIS_PLUGIN_SUBDIR})
SET (QGIS_INCLUDE_DIR ${QGIS_INCLUDE_SUBDIR})
SET (QGIS_CUSTOMWIDGETS_DIR ${QT_PLUGINS_DIR}/designer)

# set the default locations where the targets (executables, libraries) will land when compiled
# this is to allow running qgis from the source tree without having to actually do a "make install"
@@ -230,6 +230,7 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERS
bin/%PACKAGENAME%-browser.bat.tmpl ^
apps/qt4/plugins/sqldrivers/qsqlocispatial.dll ^
apps/qt4/plugins/sqldrivers/qsqlspatialite.dll ^
apps/qt4/plugins/designer/qgis_customwidgets.dll ^
etc/postinstall/%PACKAGENAME%.bat ^
etc/preremove/%PACKAGENAME%.bat
if errorlevel 1 (echo tar failed & goto error)
@@ -406,9 +406,19 @@ ENDIF (WIN32)

IF(PEDANTIC)
# disable deprecation warnings
IF(NOT MSVC)
SET_SOURCE_FILES_PROPERTIES(qgisappinterface.cpp PROPERTIES COMPILE_FLAGS -Wno-deprecated)
ENDIF(NOT MSVC)
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(
qgisappinterface.cpp
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "/wd4996"
)
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(
qgisappinterface.cpp
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations"
)
ENDIF(MSVC)
ENDIF(PEDANTIC)

INCLUDE_DIRECTORIES(
@@ -498,18 +508,6 @@ if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
SET_TARGET_PROPERTIES(qgis_app PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
ENDIF(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)

# disable deprecation warnings for classes re-exporting deprecated methods
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "-wd4996")
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(
${CMAKE_BINARY_DIR}/src/app/moc_qgisappinterface.cxx
PROPERTIES COMPILE_FLAGS "-w -Wno-deprecated-declarations")
ENDIF(MSVC)


TARGET_LINK_LIBRARIES(${QGIS_APP_NAME}
${QWT_LIBRARY}
${QT_QTSQL_LIBRARY}
@@ -392,9 +392,11 @@ ENDIF (QT_MOBILITY_LOCATION_FOUND)

QT4_WRAP_CPP(QGIS_CORE_MOC_SRCS ${QGIS_CORE_MOC_HDRS})

IF(UNIX)
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CORE_MOC_SRCS} PROPERTIES COMPILE_FLAGS "/wd4996" )
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CORE_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(UNIX)
ENDIF(MSVC)

# install headers
# install qgsconfig.h and plugin.h here so they can get into
@@ -210,7 +210,7 @@ bool QgsComposerAttributeTableColumnModel::setData( const QModelIndex& index, co
emit dataChanged( index, index );
return true;
default:
return false;
break;
}

return false;
@@ -584,14 +584,11 @@ bool QgsComposerTableSortColumnsProxyModel::setData( const QModelIndex& index, c
return false;
}

switch ( index.column() )
if ( index.column() == 1 )
{
case 1:
column->setSortOrder(( Qt::SortOrder )value.toInt() );
emit dataChanged( index, index );
return true;
default:
return false;
}

return false;
@@ -99,7 +99,7 @@ void QgsComposerTable::paint( QPainter* painter, const QStyleOptionGraphicsItem*
cell = QRectF( currentX, currentY, mMaxColumnWidthMap[col], cellHeaderHeight );

//calculate alignment of header
Qt::AlignmentFlag headerAlign;
Qt::AlignmentFlag headerAlign = Qt::AlignLeft;
switch ( mHeaderHAlignment )
{
case FollowColumn:
@@ -737,7 +737,9 @@ class CORE_EXPORT QgsPalLabeling : public QgsLabelingEngineInterface

//! called when we're going to start with rendering
//! @deprecated since 2.4 - use override with QgsMapSettings
Q_NOWARN_DEPRECATED_PUSH
Q_DECL_DEPRECATED virtual void init( QgsMapRenderer* mr );
Q_NOWARN_DEPRECATED_POP
//! called when we're going to start with rendering
virtual void init( const QgsMapSettings& mapSettings );
//! called to find out whether the layer is used for labeling
@@ -765,12 +767,15 @@ class CORE_EXPORT QgsPalLabeling : public QgsLabelingEngineInterface
virtual void drawLabeling( QgsRenderContext& context );
//! called when we're done with rendering
virtual void exit();

Q_NOWARN_DEPRECATED_PUSH
//! return infos about labels at a given (map) position
//! @deprecated since 2.4 - use takeResults() and methods of QgsLabelingResults
Q_DECL_DEPRECATED virtual QList<QgsLabelPosition> labelsAtPosition( const QgsPoint& p );
//! return infos about labels within a given (map) rectangle
//! @deprecated since 2.4 - use takeResults() and methods of QgsLabelingResults
Q_DECL_DEPRECATED virtual QList<QgsLabelPosition> labelsWithinRect( const QgsRectangle& r );
Q_NOWARN_DEPRECATED_POP

//! Return pointer to recently computed results (in drawLabeling()) and pass the ownership of results to the caller
//! @note added in 2.4
@@ -2,6 +2,13 @@ ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)

IF (WIN32)
IF (MSVC)
ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLEXPORT}")
ELSE (MSVC)
ADD_DEFINITIONS("-UCUSTOMWIDGETS_EXPORT \"-DCUSTOMWIDGETS_EXPORT=${DLLEXPORT}\"")
ENDIF (MSVC)
ENDIF (WIN32)

########################################################
# Files
@@ -30,9 +37,11 @@ SET (QGIS_CUSTOMWIDGETS_MOC_HDRS

QT4_WRAP_CPP(QGIS_CUSTOMWIDGETS_MOC_SRCS ${QGIS_CUSTOMWIDGETS_MOC_HDRS})

IF(UNIX)
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CUSTOMWIDGETS_MOC_SRCS} PROPERTIES COMPILE_FLAGS "/wd4996" )
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_CUSTOMWIDGETS_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(UNIX)
ENDIF(MSVC)

SET(QGIS_CUSTOMWIDGETS_HDRS
qgiscustomwidgets.h
@@ -78,6 +87,6 @@ TARGET_LINK_LIBRARIES(qgis_customwidgets qgis_gui)

# install
INSTALL(TARGETS qgis_customwidgets
LIBRARY DESTINATION ${QGIS_CUSTOMWIDGETS_DIR})


RUNTIME DESTINATION ${QT_PLUGINS_DIR}/designer
LIBRARY DESTINATION ${QT_PLUGINS_DIR}/designer
)
@@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsCollapsibleGroupBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsCollapsibleGroupBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
@@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsColorButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsColorButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
@@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsDataDefinedButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsDataDefinedButtonPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
@@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsFieldComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsFieldComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
@@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsFieldExpressionWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsFieldExpressionWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
@@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsMapLayerComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsMapLayerComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
@@ -20,7 +20,7 @@
#include <QDesignerCustomWidgetInterface>


class QDESIGNER_WIDGET_EXPORT QgsScaleRangeWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
class CUSTOMWIDGETS_EXPORT QgsScaleRangeWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
@@ -287,9 +287,11 @@ qgsunitselectionwidget.h

QT4_WRAP_CPP(QGIS_GUI_MOC_SRCS ${QGIS_GUI_MOC_HDRS})

IF(UNIX)
IF(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_GUI_MOC_SRCS} PROPERTIES COMPILE_FLAGS "/wd4996" )
ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(${QGIS_GUI_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(UNIX)
ENDIF(MSVC)

# for installing headers

0 comments on commit 7127e58

Please sign in to comment.