Skip to content

Commit

Permalink
Update Makefile in template dir to use qt4 uic and resource builder
Browse files Browse the repository at this point in the history
Update Makefile to use pluginlcasename


git-svn-id: http://svn.osgeo.org/qgis/trunk@4905 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Feb 23, 2006
1 parent c3c1ab3 commit c460779
Showing 1 changed file with 54 additions and 27 deletions.
81 changes: 54 additions & 27 deletions src/plugins/plugin_template/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Copyright (C) 2003 Gary Sherman <sherman at mrcc.com>
#
# Copyright (C) 2003 Gary Sherman <sherman at mrcc.com>
# and 2006 Tim Sutton <tim@linfiniti.com>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
Expand All @@ -10,44 +11,70 @@
#
# $Id$

#[pluginlcasename] below to be replaced with the name of the plugin

##
## Legacy support for pkgdatapath - you are encouraged to use
## Qt4.x resource files where possible rather!
##
if !HAVE_QTMAC
PKGDATAPATH=-DPKGDATAPATH=\"$(pkgdatadir)\"
endif

plugindir = ${pkglibdir}
#[pluginname] below to be replaced with the name of the plugin
plugin_LTLIBRARIES = [pluginname]plugin.la

#for plugin so
plugin_LTLIBRARIES = libqgis_plugin_[pluginlcasename].la

## For Qt4 intermerdiary meta object compiler files
%.moc.cpp: %.h
$(MOC) -o $@ $<

%.h: %.ui
## For Qt4 User Interface Files
ui_%.h: %.ui
$(UIC) -o $@ $<

%.cpp: %.ui
$(UIC) -o $@ -impl $*.h $<

[pluginname]plugin_la_SOURCES = plugin.cpp \
plugin.h \
plugingui.cpp \
plugingui.h \
$(plugin_UI)\
$(plugin_MOC)
## For Qt4 Resource Files
%.qrc.cpp: %.qrc
$(RCC) -o $@ $<

plugin_MOC = plugin.moc.cpp \
plugingui.moc.cpp \
pluginguibase.moc.cpp
##
## For plugin lib
##

plugin_UI = pluginguibase.h \
pluginguibase.cpp
[pluginlcasename]_la_SOURCES = [pluginlcasename].cpp \
[pluginlcasename]gui.cpp \
$(plugin_UI)\
$(plugin_MOC)\
$(plugin_QRC) \
$(plugin_RES)

plugin_UIC = pluginguibase.ui

plugin_MOC = [pluginlcasename].moc.cpp \
[pluginlcasename]gui.moc.cpp

# UI dependencies
pluginguibase.cpp: pluginguibase.h pluginguibase.ui
plugin_UI = ui_[pluginlcasename]guibase.h

BUILT_SOURCES = $(plugin_MOC) $(plugin_UI)
plugin_UIC = [pluginlcasename]guibase.ui

plugin_RES = [pluginlcasename].qrc.cpp

[pluginname]plugin_la_LIBADD = $(QT_LDADD) $(GDAL_LDADD) ../../src/libqgis.la
[pluginname]plugin_la_LDFLAGS = -avoid-version -module
[pluginname]plugin_la_CXXFLAGS = $(CXXFLAGS) $(EXTRA_CXXFLAGS) $(QT_CXXFLAGS) $(DEBUG_QGIS) -I../../src
plugin_QRC = [pluginlcasename].qrc

EXTRA_DIST = $(plugin_UIC) icon.xpm
BUILT_SOURCES = $(plugin_MOC) $(plugin_UI) $(plugin_RES)

[pluginlcasename]_la_LIBADD = $(QT_LDADD) \
$(GDAL_LDADD) \
../../core/libqgis_core.la \
../../gui/libqgis_gui.la
[pluginlcasename]_la_CFLAGS = $(CFLAGS) $(EXTRA_CFLAGS) $(DEBUG_QGIS)
[pluginlcasename]_la_CXXFLAGS = $(CXXFLAGS) \
$(EXTRA_CXXFLAGS) \
$(QT_CXXFLAGS) \
$(DEBUG_QGIS) \
$(GDAL_CFLAGS) \
$(GEOS_CFLAGS) \
-I../../core \
-I../../ui \
-I../../gui
[pluginlcasename]_la_LDFLAGS = -avoid-version -module

0 comments on commit c460779

Please sign in to comment.