Permalink
Browse files

Resolution of issue#24. Unkown segmentation fault when redirecting

exception to upper instances. The redirection were replaced by a call
caixa_msg->show(e).

New building mode defined (still testing!). User can pass the variabel
"BUILDCONF+=(static|shared)" to qmake commando to build a static linked
executable or a dynamic linked executable. Pending: Link Qt/libXml/libpq
statically.
  • Loading branch information...
1 parent 3ac3c88 commit 7292662b6cce4674022aae4578d483c63ba71fe5 @rkhaotix rkhaotix committed Oct 2, 2012
@@ -1,11 +1,11 @@
-include(../pgmodeler.pro)
-
-TEMPLATE = lib
-TARGET = conexbd
-DESTDIR = ../build/lib
-OBJECTS_DIR = obj
-
-LIBS += $$DESTDIR/$$LIBUTIL
+contains(BUILDCONF, shared) {
+ include(../pgmodeler.pro)
+ TEMPLATE = lib
+ TARGET = conexbd
+ DESTDIR = ../build/lib
+ OBJECTS_DIR = obj
+ LIBS += $$DESTDIR/$$LIBUTIL
+}
HEADERS += $$PWD/src/conexaobd.h \
$$PWD/src/resultado.h
@@ -1,12 +1,12 @@
-include(../pgmodeler.pro)
-
-TEMPLATE = lib
-TARGET = objrenderer
-DESTDIR = ../build/lib
-
-LIBS += $$DESTDIR/$$LIBUTIL \
- $$DESTDIR/$$LIBPARSERS \
- $$DESTDIR/$$LIBPGMODELER
+contains(BUILDCONF, shared) {
+ include(../pgmodeler.pro)
+ TEMPLATE = lib
+ TARGET = objrenderer
+ DESTDIR = ../build/lib
+ LIBS += $$DESTDIR/$$LIBUTIL \
+ $$DESTDIR/$$LIBPARSERS \
+ $$DESTDIR/$$LIBPGMODELER
+}
HEADERS += $$PWD/src/objetografico.h \
$$PWD/src/ogcaixatexto.h \
@@ -326,8 +326,7 @@ void CenaObjetos::removeItem(QGraphicsItem *item)
QGraphicsScene::removeItem(item);
//Desaloca o objeto (buggy!!!)
- //if(objeto)
- //delete(objeto);
+ //if(objeto) //delete(objeto);
}
}
//-----------------------------------------------------------
@@ -1,10 +1,10 @@
-include(../pgmodeler.pro)
-
-TEMPLATE = lib
-TARGET = parsers
-DESTDIR = ../build/lib
-
-LIBS += $$DESTDIR/$$LIBUTIL
+contains(BUILDCONF, shared) {
+ include(../pgmodeler.pro)
+ TEMPLATE = lib
+ TARGET = parsers
+ DESTDIR = ../build/lib
+ LIBS += $$DESTDIR/$$LIBUTIL
+}
HEADERS += $$PWD/src/parseresquema.h \
$$PWD/src/parserxml.h
@@ -1,11 +1,11 @@
-include(../pgmodeler.pro)
-
-TEMPLATE = lib
-TARGET = pgmodeler
-DESTDIR = ../build/lib
-
-LIBS += $$DESTDIR/$$LIBUTIL \
- $$DESTDIR/$$LIBPARSERS
+contains(BUILDCONF, shared) {
+ include(../pgmodeler.pro)
+ TEMPLATE = lib
+ TARGET = pgmodeler
+ DESTDIR = ../build/lib
+ LIBS += $$DESTDIR/$$LIBUTIL \
+ $$DESTDIR/$$LIBPARSERS
+}
HEADERS += $$PWD/src/caixatexto.h \
$$PWD/src/conversaotipo.h \
@@ -1,15 +1,17 @@
-include(../pgmodeler.pro)
+contains(BUILDCONF, shared) {
+ include(../pgmodeler.pro)
+ TEMPLATE = lib
+ TARGET = pgmodeler_ui
+ DESTDIR = ../build/lib
+ LIBS = $$DESTDIR/$$LIBUTIL \
+ $$DESTDIR/$$LIBPARSERS \
+ $$DESTDIR/$$LIBCONEXBD \
+ $$DESTDIR/$$LIBOBJRENDERER \
+ $$DESTDIR/$$LIBPGMODELER
+}
-TEMPLATE = lib
-TARGET = pgmodeler_ui
-DESTDIR = ../build/lib
RESOURCES += $$PWD/res/resources.qrc
-
-LIBS = $$DESTDIR/$$LIBUTIL \
- $$DESTDIR/$$LIBPARSERS \
- $$DESTDIR/$$LIBCONEXBD \
- $$DESTDIR/$$LIBOBJRENDERER \
- $$DESTDIR/$$LIBPGMODELER
+windows:RCC_DIR += $$PWD/src
SOURCES += $$PWD/src/formprincipal.cpp \
$$PWD/src/modelowidget.cpp \
@@ -2067,7 +2067,12 @@ void ModeloWidget::excluirObjetos(void)
cena->clearSelection();
emit s_objetoRemovido();
- throw Excecao(e.obterMensagemErro(),e.obterTipoErro(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e);
+
+ /** issue #24**/
+ /* Aparentemente redirencionando a exceção neste ponto é provocado um segmentation fault sem causa conhecida.
+ Uma solução alternativa é chamar a caixa de mensagem exibindo a exceção capturada. */
+ //throw Excecao(e.obterMensagemErro(),e.obterTipoErro(),__PRETTY_FUNCTION__,__FILE__,__LINE__,&e);
+ caixa_msg->show(e);
}
}
}
View
@@ -1,8 +1,9 @@
-include(../pgmodeler.pro)
-
-TEMPLATE = lib
-TARGET = util
-DESTDIR = ../build/lib
+contains(BUILDCONF, shared) {
+ include(../pgmodeler.pro)
+ TEMPLATE = lib
+ TARGET = util
+ DESTDIR = ../build/lib
+}
HEADERS += $$PWD/src/excecao.h \
$$PWD/src/atributosglobais.h \
View
@@ -4,12 +4,27 @@ TEMPLATE = app
TARGET = pgmodeler
DESTDIR = ../build
-LIBS = $$DESTDIR/lib/$$LIBUTIL \
- $$DESTDIR/lib/$$LIBPARSERS \
- $$DESTDIR/lib/$$LIBCONEXBD \
- $$DESTDIR/lib/$$LIBOBJRENDERER \
- $$DESTDIR/lib/$$LIBPGMODELER \
- $$DESTDIR/lib/$$LIBPGMODELERUI
+contains(BUILDCONF, static) {
+ include(../libutil/libutil.pro)
+ include(../libparsers/libparsers.pro)
+ include(../libconexbd/libconexbd.pro)
+ include(../libpgmodeler/libpgmodeler.pro)
+ include(../libobjrenderer/libobjrenderer.pro)
+ include(../libpgmodeler_ui/libpgmodeler_ui.pro)
+ INCLUDEPATH = $$unique(INCLUDEPATH)
+}
+
+contains(BUILDCONF, shared) {
+ LIBS += $$DESTDIR/lib/$$LIBUTIL \
+ $$DESTDIR/lib/$$LIBPARSERS \
+ $$DESTDIR/lib/$$LIBCONEXBD \
+ $$DESTDIR/lib/$$LIBOBJRENDERER \
+ $$DESTDIR/lib/$$LIBPGMODELER \
+ $$DESTDIR/lib/$$LIBPGMODELERUI
+}
HEADERS += $$PWD/src/aplicacao.h
SOURCES += $$PWD/src/main.cpp
+
+message("** Building configuration: [$$BUILDCONF] **")
+message("** Type 'make' to start build. **")
View
@@ -1,19 +1,35 @@
-CONFIG += ordered qt warn_on uitools uic4 stl rtti exceptions
+CONFIG += ordered qt stl rtti exceptions
+
+contains(CONFIG, debug) {
+ CONFIG += warn_on
+}
+
unix: CONFIG += link_pkgconfig
unix: PKGCONFIG += libxml-2.0 libpq
unix:CONFIG += x11
windows:CONFIG += windows
+unix:LIB_PREFIX = lib
+unix:LIB_EXT = so
+windows:LIB_EXT = dll
-QT += core gui qt3support
-TEMPLATE = subdirs
-MOC_DIR = moc
-OBJECTS_DIR = obj
-UI_DIR = src
+isEmpty(BUILDCONF): BUILDCONF += shared
+
+contains(BUILDCONF, shared) {
+ SUBDIRS = libutil \
+ libparsers \
+ libconexbd \
+ libpgmodeler \
+ libobjrenderer \
+ libpgmodeler_ui \
+ main \
+ plugins/dummyplugin
+}
+
+contains(BUILDCONF, static) {
+ SUBDIRS = main
+ #plugins/dummyplugin
+}
-unix:LIB_EXT = so
-unix:LIB_PREFIX = lib
-windows:SHARED_LIBS = dll
-windows:QMAKE_LFLAGS=-Wl,-enable-auto-import
LIBUTIL=$${LIB_PREFIX}util.$${LIB_EXT}
LIBPARSERS=$${LIB_PREFIX}parsers.$${LIB_EXT}
@@ -22,24 +38,22 @@ LIBPGMODELER=$${LIB_PREFIX}pgmodeler.$${LIB_EXT}
LIBOBJRENDERER=$${LIB_PREFIX}objrenderer.$${LIB_EXT}
LIBPGMODELERUI=$${LIB_PREFIX}pgmodeler_ui.$${LIB_EXT}
-INCLUDEPATH = $${GLOBAL_INCLUDES} \
- $$PWD/libutil/src \
- $$PWD/libconexbd/src \
- $$PWD/libparsers/src \
- $$PWD/libpgmodeler/src \
- $$PWD/libobjrenderer/src \
- $$PWD/libpgmodeler_ui/src
-
-LIBS = -lxml2 -lpq
-
-SUBDIRS = libutil \
- libparsers \
- libconexbd \
- libpgmodeler \
- libobjrenderer \
- libpgmodeler_ui \
- main \
- plugins/dummyplugin
+QT += core gui qt3support
+TEMPLATE = subdirs
+MOC_DIR = moc
+OBJECTS_DIR = obj
+UI_DIR = src
+
+INCLUDEPATH += $$PWD/libutil/src \
+ $$PWD/libconexbd/src \
+ $$PWD/libparsers/src \
+ $$PWD/libpgmodeler/src \
+ $$PWD/libobjrenderer/src \
+ $$PWD/libpgmodeler_ui/src
+unix:LIBS = -lxml2 -lpq
+
+windows:INCLUDEPATH += C:/mingw/include C:/PostgreSQL/9.2/include
+windows:LIBS = C:/mingw/bin/libxml2.dll C:/PostgreSQL/9.2/bin/libpq.dll
sources.files = samples schemas lang conf README.md COMPILING.md PLUGINS.md LICENSE libpgmodeler_ui/res/imagens/pgmodeler_logo.png
unix:sources.files += start-pgmodeler.sh
@@ -1,5 +1,6 @@
PGMODELER_SRC_DIR=../../
PGMODELER_LIB_DIR=$$PGMODELER_SRC_DIR/build/lib
+PGMODELER_PLUGIN_DIR=$$PGMODELER_SRC_DIR/build/plugins
!exists($$PGMODELER_SRC_DIR) {
warning("pt_BR: O diretório de código fonte do pgModeler '$$PGMODELER_SRC_DIR' não foi encontrado! Certifique-se de que a variável PGMODELER_SRC_DIR aponta para uma localização válida!")
@@ -9,27 +10,22 @@ PGMODELER_LIB_DIR=$$PGMODELER_SRC_DIR/build/lib
include($$PGMODELER_SRC_DIR/pgmodeler.pro)
-CONFIG += plugin qt warn_on uitools uic4
+CONFIG = plugin qt warn_on uitools uic4
QT = core gui qt3support
TEMPLATE = lib
TARGET = dummyplugin
TRANSLATIONS += $$PWD/lang/$$TARGET.en_US.ts
CODECFORTR = UTF8
-INCLUDEPATH = $${GLOBAL_INCLUDES} \
- $$PGMODELER_SRC_DIR/libutil/src \
- $$PGMODELER_SRC_DIR/libconexbd/src \
- $$PGMODELER_SRC_DIR/libparsers/src \
- $$PGMODELER_SRC_DIR/libpgmodeler/src \
- $$PGMODELER_SRC_DIR/libobjrenderer/src \
- $$PGMODELER_SRC_DIR/libpgmodeler_ui/src
+unix: CONFIG += link_pkgconfig
+unix: PKGCONFIG += libxml-2.0 libpq
DEPENDPATH = ". res src ui moc obj"
MOC_DIR = moc
OBJECTS_DIR = obj
UI_DIR = src
-DESTDIR = ../../build/plugins/$$TARGET
+DESTDIR = build
LIBS = $$PGMODELER_LIB_DIR/$$LIBUTIL \
$$PGMODELER_LIB_DIR/$$LIBPARSERS \
@@ -38,21 +34,9 @@ LIBS = $$PGMODELER_LIB_DIR/$$LIBUTIL \
$$PGMODELER_LIB_DIR/$$LIBPGMODELER \
$$PGMODELER_LIB_DIR/$$LIBPGMODELERUI
-unix {
- QMAKE_POST_LINK+= "cp res/$${TARGET}.png $$DESTDIR;\
- cp -r lang/ $$DESTDIR;"
- QMAKE_DISTCLEAN+= "-r $$MOC_DIR $$OBJECTS_DIR"
-}
-
-windows {
- DEST=..\\..\\build\\plugins\\$$TARGET
- QMAKE_POST_LINK+= "copy res\\$${TARGET}.png $$DEST /Y &\
- xcopy lang $$DEST\\lang /S /I /Y /Q"
- QMAKE_DISTCLEAN+= "$$MOC_DIR /S /Q & \
- $$OBJECTS_DIR /S /Q"
-}
-
-
HEADERS += src/dummyplugin.h
SOURCES += src/dummyplugin.cpp
+dummy.files = res/dummyplugin.png lang build/libdummyplugin.so
+dummy.path = $$PGMODELER_PLUGIN_DIR/$$TARGET
+INSTALLS += dummy

0 comments on commit 7292662

Please sign in to comment.