Skip to content

Commit

Permalink
fix CMakeLists
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids committed May 12, 2014
1 parent 4aa7233 commit 148021c
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 53 deletions.
11 changes: 2 additions & 9 deletions CMakeLists.txt
Expand Up @@ -46,6 +46,7 @@ IF(WITH_MAPSERVER)
SET (MAPSERVER_SKIP_ECW FALSE CACHE BOOL "Determines whether QGIS mapserver should disable ECW (ECW in server apps requires a special license)")
ENDIF(WITH_MAPSERVER)

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

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


INCLUDE( ${QT_USE_FILE} )

IF (WITH_CUSTOM_WIDGETS)
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)
ENDIF (WITH_CUSTOM_WIDGETS)

# Disable automatic conversion from QString to ASCII 8-bit strings (char *)
# (Keeps code compatible with Qt/Mac/64bit)
ADD_DEFINITIONS(-DQT_NO_CAST_TO_ASCII)
Expand Down Expand Up @@ -517,7 +511,6 @@ ADD_DEFINITIONS("-DCORE_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DGUI_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DPYTHON_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DANALYSIS_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DCUSTOMWIDGETS_EXPORT=${DLLIMPORT}")
ADD_DEFINITIONS("-DAPP_EXPORT=${DLLIMPORT}")

#############################################################
Expand Down Expand Up @@ -602,7 +595,7 @@ ENDIF (NOT EXISTS QSCINTILLA_VERSION_STR AND EXISTS QSCI_MOD_VERSION_STR)
# installed with app target

CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/cmake_templates/qgsconfig.h.in ${CMAKE_BINARY_DIR}/qgsconfig.h)
INCLUDE_DIRECTORIES(${QT_INCLUDES} ${CMAKE_BINARY_DIR})
INCLUDE_DIRECTORIES(${CMAKE_BINARY_DIR})

# Added by Jef to prevent python core and gui libs linking to other qgisCore and qgisGui libs
# that may be in the same install prefix
Expand Down
47 changes: 8 additions & 39 deletions src/customwidgets/CMakeLists.txt
@@ -1,3 +1,7 @@
ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)


########################################################
# Files
Expand Down Expand Up @@ -46,36 +50,15 @@ INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_BINARY_DIR}/../ui
)

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


#############################################################
# qgis_customwidgets library

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

IF(NOT APPLE)
INSTALL(FILES ${QGIS_CUSTOMWIDGETS_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})
ELSE(NOT APPLE)
SET_TARGET_PROPERTIES(qgis_customwidgets PROPERTIES
# no moc headers, messes up PROPERTIES syntax
CLEAN_DIRECT_OUTPUT 1
FRAMEWORK 1
FRAMEWORK_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}"
MACOSX_FRAMEWORK_INFO_PLIST "${CMAKE_SOURCE_DIR}/mac/framework.info.plist.in"
MACOSX_FRAMEWORK_SHORT_VERSION_STRING ${COMPLETE_VERSION}
MACOSX_FRAMEWORK_IDENTIFIER org.qgis.qgis2_customwidgets
BUILD_WITH_INSTALL_RPATH TRUE
PUBLIC_HEADER "${QGIS_CUSTOMWIDGETS_HDRS}"
LINK_FLAGS "${CMAKE_SHARED_LINKER_FLAGS}"
)
ENDIF(NOT APPLE)
# TODO: apple
INSTALL(FILES ${QGIS_CUSTOMWIDGETS_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})


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

TARGET_LINK_LIBRARIES(qgis_customwidgets qgis_gui)


# install

INSTALL(TARGETS qgis_customwidgets
LIBRARY DESTINATION ${QGIS_CUSTOMWIDGETS_DIR}
PUBLIC_HEADER DESTINATION ${QGIS_INCLUDE_DIR})

# ui headers to install, don't exist at target definition time, install manually
IF (APPLE)
INSTALL(FILES ${QGIS_CUSTOMWIDGETS_UI_HDRS} DESTINATION ${QGIS_FW_SUBDIR}/qgis_gui.framework/Headers)
ELSE (APPLE)
INSTALL(FILES ${QGIS_CUSTOMWIDGETS_UI_HDRS} DESTINATION ${QGIS_INCLUDE_DIR})
ENDIF (APPLE)

# Mac dev frameworks
#IF (APPLE AND QGIS_MACAPP_INSTALL_DEV)
# INSTALL(TARGETS qgis_customwidgets FRAMEWORK DESTINATION ${QGIS_MACAPP_DEV_PREFIX})
# 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\")")
# 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\")")
#ENDIF (APPLE AND QGIS_MACAPP_INSTALL_DEV)

4 changes: 3 additions & 1 deletion src/customwidgets/qgscollapsiblegroupboxplugin.h
Expand Up @@ -16,9 +16,11 @@
#ifndef QGSCOLLAPSIBLEGROUPBOXPLUGIN_H
#define QGSCOLLAPSIBLEGROUPBOXPLUGIN_H

#include <QDesignerExportWidget>
#include <QDesignerCustomWidgetInterface>

class CUSTOMWIDGETS_EXPORT QgsCollapsibleGroupBoxPlugin : public QObject, public QDesignerCustomWidgetInterface

class QDESIGNER_WIDGET_EXPORT QgsCollapsibleGroupBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
4 changes: 3 additions & 1 deletion src/customwidgets/qgsfieldcomboboxplugin.h
Expand Up @@ -16,9 +16,11 @@
#ifndef QGSFIELDCOMBOBOXPLUGIN_H
#define QGSFIELDCOMBOBOXPLUGIN_H

#include <QDesignerExportWidget>
#include <QDesignerCustomWidgetInterface>

class CUSTOMWIDGETS_EXPORT QgsFieldComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface

class QDESIGNER_WIDGET_EXPORT QgsFieldComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
4 changes: 3 additions & 1 deletion src/customwidgets/qgsfieldexpressionwidgetplugin.h
Expand Up @@ -16,9 +16,11 @@
#ifndef QGSFIELDEXPRESSIONWIDGETPLUGIN_H
#define QGSFIELDEXPRESSIONWIDGETPLUGIN_H

#include <QDesignerExportWidget>
#include <QDesignerCustomWidgetInterface>

class CUSTOMWIDGETS_EXPORT QgsFieldExpressionWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface

class QDESIGNER_WIDGET_EXPORT QgsFieldExpressionWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
4 changes: 3 additions & 1 deletion src/customwidgets/qgsmaplayercomboboxplugin.h
Expand Up @@ -16,9 +16,11 @@
#ifndef QGSMAPLAYERCOMBOBOXPLUGIN_H
#define QGSMAPLAYERCOMBOBOXPLUGIN_H

#include <QDesignerExportWidget>
#include <QDesignerCustomWidgetInterface>

class CUSTOMWIDGETS_EXPORT QgsMapLayerComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface

class QDESIGNER_WIDGET_EXPORT QgsMapLayerComboBoxPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down
4 changes: 3 additions & 1 deletion src/customwidgets/qgsscalevisibilitywidgetplugin.h
Expand Up @@ -16,9 +16,11 @@
#ifndef QGSSCALEVISIBILITYWIDGETPLUGIN_H
#define QGSSCALEVISIBILITYWIDGETPLUGIN_H

#include <QDesignerExportWidget>
#include <QDesignerCustomWidgetInterface>

class CUSTOMWIDGETS_EXPORT QgsScaleVisibilityWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface

class QDESIGNER_WIDGET_EXPORT QgsScaleVisibilityWidgetPlugin : public QObject, public QDesignerCustomWidgetInterface
{
Q_OBJECT
Q_INTERFACES( QDesignerCustomWidgetInterface )
Expand Down

0 comments on commit 148021c

Please sign in to comment.