diff options
-rw-r--r-- | checklist-macosx.txt | 12 | ||||
-rw-r--r-- | mainwin.cc | 53 | ||||
-rw-r--r-- | openscad.pro | 69 | ||||
-rw-r--r-- | release-linux.sh | 4 | ||||
-rwxr-xr-x | release-macosx.sh | 10 |
5 files changed, 85 insertions, 63 deletions
diff --git a/checklist-macosx.txt b/checklist-macosx.txt index a6b5145..f863ccd 100644 --- a/checklist-macosx.txt +++ b/checklist-macosx.txt @@ -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 @@ -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 diff --git a/openscad.pro b/openscad.pro index 23e076e..7ba2580 100644 --- a/openscad.pro +++ b/openscad.pro @@ -1,42 +1,60 @@ +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 -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 +#CONFIG += mdi +CONFIG += cgal +CONFIG += opencsg -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 +mdi { + # MDI needs an OpenCSG library that is compiled with OpenCSG-Reset-Hack.patch applied + DEFINES += ENABLE_MDI } -else { - LIBS += -lmpfr + +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 } -DEFINES += ENABLE_OPENCSG -LIBS += -lopencsg +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 + } +} -unix:LIBS += -lGLEW -win32:LIBS += -lglew32 -lboost_thread -lgmp +QMAKE_CXXFLAGS_RELEASE = -O3 -march=pentium +QMAKE_CXXFLAGS_DEBUG = -O0 -ggdb 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 - diff --git a/release-linux.sh b/release-linux.sh index a097a0c..6294fbc 100644 --- a/release-linux.sh +++ b/release-linux.sh @@ -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 diff --git a/release-macosx.sh b/release-macosx.sh index 95223f9..f92e723 100755 --- a/release-macosx.sh +++ b/release-macosx.sh @@ -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 |