Slowly getting the build system under control, added version number in app, added OpenSCAD to window title, note that VERSION needs to be set for deployment in the deployment scripts

git-svn-id: http://svn.clifford.at/openscad/trunk@168 b57f626f-c46c-0410-a088-ec61d464b74c
stl_dim
kintel 2009-12-13 00:22:07 +00:00
parent 6628f644d2
commit 0847ea818b
5 changed files with 88 additions and 66 deletions

View File

@ -16,14 +16,10 @@ o Build OpenCSG
qmake -recursive
make
o Build OpenSCAD
o Build and Deploy OpenSCAD
# If MDI: edit openscad.pro and set ENABLE_MDI=1
# Update OPENSCAD_VERSION in release-macosx.sh
# If MDI: edit openscad.pro and enable CONFIG += mdi
# FIXME: Debug vs. release flags
cd openscad
qmake
make -j4
o Deploy
./release-macosx.sh

View File

@ -65,8 +65,14 @@
#endif
static char helptext[] =
"OpenSCAD (www.openscad.org)\n"
#define QUOTE(x__) # x__
#define QUOTED(x__) QUOTE(x__)
static char helptitle[] =
"OpenSCAD "
QUOTED(OPENSCAD_VERSION)
" (www.openscad.org)\n";
static char copyrighttext[] =
"Copyright (C) 2009 Clifford Wolf <clifford@clifford.at>\n"
"\n"
"This program is free software; you can redistribute it and/or modify"
@ -162,7 +168,11 @@ MainWindow::MainWindow(const char *filename)
// Design menu
connect(this->designActionReloadAndCompile, SIGNAL(triggered()), this, SLOT(actionReloadCompile()));
connect(this->designActionCompile, SIGNAL(triggered()), this, SLOT(actionCompile()));
#ifdef ENABLE_CGAL
connect(this->designActionCompileAndRender, SIGNAL(triggered()), this, SLOT(actionRenderCGAL()));
#else
this->designActionCompileAndRender->setVisible(false);
#endif
connect(this->designActionDisplayAST, SIGNAL(triggered()), this, SLOT(actionDisplayAST()));
connect(this->designActionDisplayCSGTree, SIGNAL(triggered()), this, SLOT(actionDisplayCSGTree()));
connect(this->designActionDisplayCSGProducts, SIGNAL(triggered()), this, SLOT(actionDisplayCSGProducts()));
@ -170,17 +180,22 @@ MainWindow::MainWindow(const char *filename)
connect(this->designActionExportOFF, SIGNAL(triggered()), this, SLOT(actionExportOFF()));
// View menu
connect(this->viewActionOpenCSG, SIGNAL(triggered()), this, SLOT(viewModeOpenCSG()));
#ifndef ENABLE_OPENCSG
this->viewActionOpenCSG->setVisible(false);
#else
connect(this->viewActionOpenCSG, SIGNAL(triggered()), this, SLOT(viewModeOpenCSG()));
if (!screen->opencsg_support) {
this->viewActionOpenCSG->setEnabled(false);
}
#endif
#ifdef ENABLE_CGAL
connect(this->viewActionCGALSurfaces, SIGNAL(triggered()), this, SLOT(viewModeCGALSurface()));
connect(this->viewActionCGALGrid, SIGNAL(triggered()), this, SLOT(viewModeCGALGrid()));
#else
this->viewActionCGALSurfaces->setVisible(false);
this->viewActionCGALGrid->setVisible(false);
#endif
connect(this->viewActionThrownTogether, SIGNAL(triggered()), this, SLOT(viewModeThrownTogether()));
connect(this->viewActionShowEdges, SIGNAL(triggered()), this, SLOT(viewModeShowEdges()));
connect(this->viewActionShowAxes, SIGNAL(triggered()), this, SLOT(viewModeShowAxes()));
@ -210,18 +225,16 @@ MainWindow::MainWindow(const char *filename)
console->setReadOnly(true);
current_win = this;
PRINT(helptext);
PRINT(helptitle);
PRINT(copyrighttext);
PRINT("");
editor->setTabStopWidth(30);
if (filename) {
this->filename = QString(filename);
maybe_change_dir();
setWindowTitle(this->filename);
load();
openFile(filename);
} else {
setWindowTitle("New Document");
setWindowTitle("OpenSCAD - New Document[*]");
}
connect(editor->document(), SIGNAL(contentsChanged()), this, SLOT(animateUpdateDocChanged()));
@ -285,7 +298,7 @@ MainWindow::openFile(const QString &new_filename)
#endif
filename = new_filename;
maybe_change_dir();
setWindowTitle(filename);
setWindowTitle("OpenSCAD - " + filename + "[*]");
load();
}
@ -557,7 +570,7 @@ void MainWindow::actionNew()
new MainWindow;
#else
filename = QString();
setWindowTitle("New Document");
setWindowTitle("OpenSCAD - New Document[*]");
editor->setPlainText("");
#endif
}
@ -591,7 +604,7 @@ void MainWindow::actionSaveAs()
if (!new_filename.isEmpty()) {
filename = new_filename;
maybe_change_dir();
setWindowTitle(filename);
setWindowTitle("OpenSCAD - " + filename + "[*]");
actionSave();
}
}
@ -1316,18 +1329,7 @@ void MainWindow::dropEvent(QDropEvent *event)
for (int i = 0; i < urls.size(); i++) {
if (urls[i].scheme() != "file")
continue;
QString fn = urls[i].path();
#ifdef ENABLE_MDI
if (!editor->toPlainText().isEmpty()) {
new MainWindow(fn.toUtf8());
break;
}
#endif
filename = fn;
setWindowTitle(filename);
maybe_change_dir();
load();
break;
openFile(urls[i].path());
}
current_win = NULL;
}
@ -1336,7 +1338,8 @@ void
MainWindow::helpAbout()
{
qApp->setWindowIcon(QApplication::windowIcon());
QMessageBox::information(this, "About OpenSCAD", helptext);
QMessageBox::information(this, "About OpenSCAD",
QString(helptitle) + QString(copyrighttext));
}
void

View File

@ -1,43 +1,61 @@
isEmpty(VERSION) VERSION = 9999.99
DEFINES += OPENSCAD_VERSION=$$VERSION
TEMPLATE = app
macx {
TARGET = OpenSCAD
ICON = OpenSCAD.icns
QMAKE_INFO_PLIST = Info.plist
TARGET = OpenSCAD
ICON = OpenSCAD.icns
QMAKE_INFO_PLIST = Info.plist
#CONFIG += x86 ppc
}
else {
TARGET = openscad
TARGET = openscad
}
CONFIG += qt
TEMPLATE = app
QT += opengl
# Application configuration
CONFIG += debug
# CONFIG += release
#CONFIG += mdi
CONFIG += cgal
CONFIG += opencsg
mdi {
# MDI needs an OpenCSG library that is compiled with OpenCSG-Reset-Hack.patch applied
DEFINES += ENABLE_MDI
}
cgal {
DEFINES += ENABLE_CGAL
LIBS += -lCGAL
macx {
INCLUDEPATH += $(PWD)/../install/include /opt/local/include
# The -L/usr/lib is to force the linker to use system libraries over MacPort libraries
LIBS += -L/usr/lib -L$(PWD)/../install/lib -L/opt/local/lib /opt/local/lib/libgmp.a /opt/local/lib/libmpfr.a /opt/local/lib/libboost_thread-mt.a
QMAKE_CXXFLAGS += -frounding-math
}
else {
LIBS += -lmpfr
}
win32:LIBS += -lboost_thread -lgmp
}
opencsg {
DEFINES += ENABLE_OPENCSG
LIBS += -L/opt/local/lib -lopencsg
unix:LIBS += -lGLEW
win32:LIBS += -lglew32
macx {
INCLUDEPATH += $(PWD)/../OpenCSG-1.1.1/include /opt/local/include
LIBS += -L$(PWD)/../OpenCSG-1.1.1/lib
}
}
QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentium
QMAKE_CXXFLAGS_DEBUG = -O0 -ggdb
# MDI needs an OpenCSG library that is compiled with OpenCSG-Reset-Hack.patch applied
DEFINES += ENABLE_MDI
DEFINES += ENABLE_CGAL
LIBS += -lCGAL
macx {
INCLUDEPATH += $(PWD)/../install/include $(PWD)/../OpenCSG-1.1.1/include /opt/local/include
# The -L/usr/lib is to force the linker to use system libraries over MacPort libraries
LIBS += -L/usr/lib -L$(PWD)/../install/lib -L$(PWD)/../OpenCSG-1.1.1/lib -L/opt/local/lib /opt/local/lib/libgmp.a /opt/local/lib/libmpfr.a /opt/local/lib/libboost_thread-mt.a
QMAKE_CXXFLAGS += -frounding-math
}
else {
LIBS += -lmpfr
}
DEFINES += ENABLE_OPENCSG
LIBS += -lopencsg
unix:LIBS += -lGLEW
win32:LIBS += -lglew32 -lboost_thread -lgmp
LEXSOURCES += lexer.l
YACCSOURCES += parser.y
@ -58,8 +76,5 @@ SOURCES += openscad.cc mainwin.cc glview.cc export.cc \
dxflinextrude.cc dxfrotextrude.cc highlighter.cc \
printutils.cc
QT += opengl
target.path = /usr/local/bin/
INSTALLS += target

View File

@ -1,11 +1,13 @@
#!/bin/sh
# WARNING: This script might only work with the authors setup...
VERSION=2010.01
set -ex
# svnclean
qmake
qmake VERSION=$VERSION
make
rm -rf release

View File

@ -1,8 +1,12 @@
#!/bin/sh
# WARNING: This script might only work with the authors setup...
VERSION=2009.11
VERSION=2010.01
echo "Building.."
qmake VERSION=$VERSION
make clean
make -j2
echo "Preparing executable.."
mkdir OpenSCAD.app/Contents/Frameworks
cp ../OpenCSG-1.1.1/lib/libopencsg.dylib OpenSCAD.app/Contents/Frameworks
@ -17,10 +21,12 @@ install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/..
install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/Frameworks/QtOpenGL
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/QtOpenGL
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/QtGui
install_name_tool -change /opt/local/lib/libGLEW.1.5.1.dylib @executable_path/../Frameworks/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/MacOS/openscad
install_name_tool -change /opt/local/lib/libGLEW.1.5.1.dylib @executable_path/../Frameworks/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/MacOS/openscad
install_name_tool -id libopencsg.dylib OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
install_name_tool -change /opt/local/lib/libGLEW.1.5.1.dylib @executable_path/../Frameworks/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
install_name_tool -id libGLEW.1.5.1.dylib OpenSCAD.app/Contents/Frameworks/libGLEW.1.5.1.dylib
echo "Creating directory structure.."
rm -rf openscad-$VERSION