Skip to content

Commit 148021c

Browse files
committed
fix CMakeLists
1 parent 4aa7233 commit 148021c

7 files changed

+25
-53
lines changed

CMakeLists.txt

+2-9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ IF(WITH_MAPSERVER)
4646
SET (MAPSERVER_SKIP_ECW FALSE CACHE BOOL "Determines whether QGIS mapserver should disable ECW (ECW in server apps requires a special license)")
4747
ENDIF(WITH_MAPSERVER)
4848

49+
# Custom widgets
4950
SET (WITH_CUSTOM_WIDGETS FALSE CACHE BOOL "Determines whether QGIS custom widgets for Qt Designer should be built")
5051

5152
# build our version of astyle
@@ -287,15 +288,8 @@ IF (ENABLE_TESTS)
287288
add_custom_target(check-no-x COMMAND xvfb-run --server-args="-screen 10,1024x768x24" ctest --output-on-failure)
288289
ENDIF (ENABLE_TESTS)
289290

290-
291291
INCLUDE( ${QT_USE_FILE} )
292292

293-
IF (WITH_CUSTOM_WIDGETS)
294-
ADD_DEFINITIONS(-DQT_PLUGIN)
295-
ADD_DEFINITIONS(-DQT_NO_DEBUG)
296-
ADD_DEFINITIONS(-DQT_SHARED)
297-
ENDIF (WITH_CUSTOM_WIDGETS)
298-
299293
# Disable automatic conversion from QString to ASCII 8-bit strings (char *)
300294
# (Keeps code compatible with Qt/Mac/64bit)
301295
ADD_DEFINITIONS(-DQT_NO_CAST_TO_ASCII)
@@ -517,7 +511,6 @@ ADD_DEFINITIONS("-DCORE_EXPORT=${DLLIMPORT}")
517511
ADD_DEFINITIONS("-DGUI_EXPORT=${DLLIMPORT}")
518512
ADD_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
519513
ADD_DEFINITIONS("-DANALYSIS_EXPORT=${DLLIMPORT}")
520-
ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLIMPORT}")
521514
ADD_DEFINITIONS("-DAPP_EXPORT=${DLLIMPORT}")
522515

523516
#############################################################
@@ -602,7 +595,7 @@ ENDIF (NOT EXISTS QSCINTILLA_VERSION_STR AND EXISTS QSCI_MOD_VERSION_STR)
602595
# installed with app target
603596

604597
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake_templates/qgsconfig.h.in ${CMAKE_BINARY_DIR}/qgsconfig.h)
605-
INCLUDE_DIRECTORIES(${QT_INCLUDES} ${CMAKE_BINARY_DIR})
598+
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})
606599

607600
# Added by Jef to prevent python core and gui libs linking to other qgisCore and qgisGui libs
608601
# that may be in the same install prefix

src/customwidgets/CMakeLists.txt

+8-39
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
ADD_DEFINITIONS(-DQT_PLUGIN)
2+
ADD_DEFINITIONS(-DQT_NO_DEBUG)
3+
ADD_DEFINITIONS(-DQT_SHARED)
4+
15

26
########################################################
37
# Files
@@ -46,36 +50,15 @@ INCLUDE_DIRECTORIES(
4650
${CMAKE_CURRENT_BINARY_DIR}/../ui
4751
)
4852

49-
IF (WIN32)
50-
IF (MSVC)
51-
ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLEXPORT}")
52-
ELSE (MSVC)
53-
ADD_DEFINITIONS("-UCUSTOMWIDGETS_EXPORT \"-DCUSTOMWIDGETS_EXPORT=${DLLEXPORT}\"")
54-
ENDIF (MSVC)
55-
ENDIF (WIN32)
56-
5753

5854
#############################################################
5955
# qgis_customwidgets library
6056

6157
ADD_LIBRARY(qgis_customwidgets SHARED ${QGIS_CUSTOMWIDGETS_SRCS} ${QGIS_CUSTOMWIDGETS_MOC_SRCS} ${QGIS_CUSTOMWIDGETS_HDRS})
6258

63-
IF(NOT APPLE)
64-
INSTALL(FILES ${QGIS_CUSTOMWIDGETS_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})
65-
ELSE(NOT APPLE)
66-
SET_TARGET_PROPERTIES(qgis_customwidgets PROPERTIES
67-
# no moc headers, messes up PROPERTIES syntax
68-
CLEAN_DIRECT_OUTPUT 1
69-
FRAMEWORK 1
70-
FRAMEWORK_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}"
71-
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/mac/framework.info.plist.in"
72-
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${COMPLETE_VERSION}
73-
MACOSX_FRAMEWORK_IDENTIFIER org.qgis.qgis2_customwidgets
74-
BUILD_WITH_INSTALL_RPATH TRUE
75-
PUBLIC_HEADER "${QGIS_CUSTOMWIDGETS_HDRS}"
76-
LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}"
77-
)
78-
ENDIF(NOT APPLE)
59+
# TODO: apple
60+
INSTALL(FILES ${QGIS_CUSTOMWIDGETS_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})
61+
7962

8063
#generate unversioned libs for android
8164
IF (NOT ANDROID)
@@ -90,23 +73,9 @@ ADD_DEPENDENCIES(qgis_customwidgets ui)
9073

9174
TARGET_LINK_LIBRARIES(qgis_customwidgets qgis_gui)
9275

93-
9476
# install
95-
9677
INSTALL(TARGETS qgis_customwidgets
9778
LIBRARY DESTINATION ${QGIS_CUSTOMWIDGETS_DIR}
9879
PUBLIC_HEADER DESTINATION ${QGIS_INCLUDE_DIR})
9980

100-
# ui headers to install, don't exist at target definition time, install manually
101-
IF (APPLE)
102-
INSTALL(FILES ${QGIS_CUSTOMWIDGETS_UI_HDRS} DESTINATION ${QGIS_FW_SUBDIR}/qgis_gui.framework/Headers)
103-
ELSE (APPLE)
104-
INSTALL(FILES ${QGIS_CUSTOMWIDGETS_UI_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})
105-
ENDIF (APPLE)
106-
107-
# Mac dev frameworks
108-
#IF (APPLE AND QGIS_MACAPP_INSTALL_DEV)
109-
# INSTALL(TARGETS qgis_customwidgets FRAMEWORK DESTINATION ${QGIS_MACAPP_DEV_PREFIX})
110-
# INSTALL(CODE "EXECUTE_PROCESS(COMMAND install_name_tool -id \"${QGIS_MACAPP_DEV_PREFIX}/qgis_customwidgets.framework/Versions/${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}/qgis_customwidgets\" \"$ENV{DESTDIR}${QGIS_MACAPP_DEV_PREFIX}/qgis_customwidgets.framework/qgis_customwidgets\")")
111-
# INSTALL(CODE "EXECUTE_PROCESS(COMMAND install_name_tool -change \"${CMAKE_INSTALL_NAME_DIR}/qgis_core.framework/Versions/${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}/qgis_core\" \"${QGIS_MACAPP_DEV_PREFIX}/qgis_core.framework/Versions/${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}/qgis_core\" \"$ENV{DESTDIR}${QGIS_MACAPP_DEV_PREFIX}/qgis_customwidgets.framework/qgis_customwidgets\")")
112-
#ENDIF (APPLE AND QGIS_MACAPP_INSTALL_DEV)
81+

src/customwidgets/qgscollapsiblegroupboxplugin.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
#ifndef QGSCOLLAPSIBLEGROUPBOXPLUGIN_H
1717
#define QGSCOLLAPSIBLEGROUPBOXPLUGIN_H
1818

19+
#include <QDesignerExportWidget>
1920
#include <QDesignerCustomWidgetInterface>
2021

21-
class CUSTOMWIDGETS_EXPORT QgsCollapsibleGroupBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
22+
23+
class QDESIGNER_WIDGET_EXPORT QgsCollapsibleGroupBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
2224
{
2325
Q_OBJECT
2426
Q_INTERFACES( QDesignerCustomWidgetInterface )

src/customwidgets/qgsfieldcomboboxplugin.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
#ifndef QGSFIELDCOMBOBOXPLUGIN_H
1717
#define QGSFIELDCOMBOBOXPLUGIN_H
1818

19+
#include <QDesignerExportWidget>
1920
#include <QDesignerCustomWidgetInterface>
2021

21-
class CUSTOMWIDGETS_EXPORT QgsFieldComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
22+
23+
class QDESIGNER_WIDGET_EXPORT QgsFieldComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
2224
{
2325
Q_OBJECT
2426
Q_INTERFACES( QDesignerCustomWidgetInterface )

src/customwidgets/qgsfieldexpressionwidgetplugin.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
#ifndef QGSFIELDEXPRESSIONWIDGETPLUGIN_H
1717
#define QGSFIELDEXPRESSIONWIDGETPLUGIN_H
1818

19+
#include <QDesignerExportWidget>
1920
#include <QDesignerCustomWidgetInterface>
2021

21-
class CUSTOMWIDGETS_EXPORT QgsFieldExpressionWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
22+
23+
class QDESIGNER_WIDGET_EXPORT QgsFieldExpressionWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
2224
{
2325
Q_OBJECT
2426
Q_INTERFACES( QDesignerCustomWidgetInterface )

src/customwidgets/qgsmaplayercomboboxplugin.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
#ifndef QGSMAPLAYERCOMBOBOXPLUGIN_H
1717
#define QGSMAPLAYERCOMBOBOXPLUGIN_H
1818

19+
#include <QDesignerExportWidget>
1920
#include <QDesignerCustomWidgetInterface>
2021

21-
class CUSTOMWIDGETS_EXPORT QgsMapLayerComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
22+
23+
class QDESIGNER_WIDGET_EXPORT QgsMapLayerComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
2224
{
2325
Q_OBJECT
2426
Q_INTERFACES( QDesignerCustomWidgetInterface )

src/customwidgets/qgsscalevisibilitywidgetplugin.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,11 @@
1616
#ifndef QGSSCALEVISIBILITYWIDGETPLUGIN_H
1717
#define QGSSCALEVISIBILITYWIDGETPLUGIN_H
1818

19+
#include <QDesignerExportWidget>
1920
#include <QDesignerCustomWidgetInterface>
2021

21-
class CUSTOMWIDGETS_EXPORT QgsScaleVisibilityWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
22+
23+
class QDESIGNER_WIDGET_EXPORT QgsScaleVisibilityWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
2224
{
2325
Q_OBJECT
2426
Q_INTERFACES( QDesignerCustomWidgetInterface )

0 commit comments

Comments
 (0)