Permalink
Browse files

Merge branch 'master' into lion

  • Loading branch information...
2 parents bbb0538 + 12ff22c commit 548a5681b35535e9548ae5472800f966105d7318 @kintel kintel committed Jul 26, 2012
View
@@ -85,7 +85,7 @@ are build scripts that download and compile the libraries from source.
Follow the instructions for the platform you're compiling on below.
* [Qt4 (4.4 - 4.7)](http://www.qt.nokia.com/)
-* [CGAL (3.6 - 3.9)](http://www.cgal.org/)
+* [CGAL (3.6 - 4.0.2)](http://www.cgal.org/)
* [GMP (5.0.x)](http://www.gmplib.org/)
* [cmake (2.6 - 2.8, required by CGAL and the test framework)](http://www.cmake.org/)
* [MPFR (3.x)](http://www.mpfr.org/)
@@ -97,6 +97,20 @@ Follow the instructions for the platform you're compiling on below.
* [Bison (2.4)](http://www.gnu.org/software/bison/)
* [Flex (2.5.35)](http://flex.sourceforge.net/)
+### Getting the source code
+
+Install git (http://git-scm.com/) onto your system. Then run a clone:
+
+ git clone git://github.com/openscad/openscad.git
+
+This will download the latest sources into a directory named 'openscad'.
+
+To pull the MCAD library (http://reprap.org/wiki/MCAD), do the following:
+
+ cd openscad
+ git submodule init
+ git submodule update
+
### Building for Mac OS X
First, make sure that you have XCode installed to get GCC. Then after
@@ -124,9 +138,9 @@ Then after you've cloned this git repository, use a package manager to
download packages for the dependency libraries listed above. Convenience
scripts are provided for some popular systems:
-Ubuntu, Debian: ./scripts/ubuntu-build-dependencies.sh
-OpenSUSE: ./scripts/opensuse-build-dependencies.sh
-Fedora, Redhat: ./scripts/fedora-build-dependencies.sh
+ Ubuntu, Debian: ./scripts/ubuntu-build-dependencies.sh
+ OpenSUSE: ./scripts/opensuse-build-dependencies.sh
+ Fedora: ./scripts/fedora-build-dependencies.sh
Check your library versions to make sure they meet the minimum
requirements listed above. After that follow the Compilation
View
@@ -25,4 +25,8 @@ cgal {
QMAKE_CXXFLAGS += -frounding-math
}
}
+
+ *clang* {
+ QMAKE_CXXFLAGS -= -frounding-math
+ }
}
View
@@ -103,6 +103,16 @@ netbsd* {
QMAKE_CXXFLAGS *= -fno-strict-aliasing
}
+*clang* {
+ # disable enormous amount of warnings about CGAL
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-variable
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-function
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-c++11-extensions
+ # might want to actually turn this on once in a while
+ QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare
+}
+
CONFIG(skip-version-check) {
# force the use of outdated libraries
DEFINES += OPENSCAD_SKIP_VERSION_CHECK
@@ -0,0 +1,28 @@
+#!/usr/local/bin/bash -e
+
+echo "Tested on FreeBSD 9. Please see README.md for info on older systems."
+
+if [ "`pkg_info | grep -i cgal `" ]; then
+ echo Stopping. Please remove any CGAL packages you have installed and restart
+ exit
+fi
+
+if [ "`pkg_info | grep -i opencsg`" ]; then
+ echo Stopping. Please remove any OpenCSG packages you have installed and restart
+ exit
+fi
+
+OPENSCADDIR=$PWD
+if [ ! -f $OPENSCADDIR/openscad.pro ]; then
+ echo "Must be run from the OpenSCAD source root directory"
+ exit 0
+fi
+
+. ./scripts/setenv-freebsdbuild.sh
+
+pkg_add -r bison boost-libs cmake git bash eigen2 flex gmake gmp mpfr
+pkg_add -r xorg libGLU libXmu libXi xorg-vfbserver glew
+pkg_add -r qt4-corelib qt4-gui qt4-moc qt4-opengl qt4-qmake qt4-rcc qt4-uic
+
+BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh cgal-use-sys-libs
+BASEDIR=/usr/local ./scripts/linux-build-dependencies.sh opencsg
@@ -118,8 +118,15 @@ build_boost()
cd boost_$bversion
# We only need certain portions of boost
./bootstrap.sh --prefix=$DEPLOYDIR --with-libraries=thread,program_options,filesystem,system,regex
- ./bjam -j$NUMCPU
- ./bjam install
+ if [ $CXX ]; then
+ if [ $CXX = "clang" ]; then
+ ./b2 -j$NUMCPU toolset=clang install
+ # ./b2 -j$NUMCPU toolset=clang cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++" install
+ fi
+ else
+ ./b2 -j$NUMCPU
+ ./b2 install
+ fi
}
build_cgal()
@@ -129,15 +136,16 @@ build_cgal()
cd $BASEDIR/src
rm -rf CGAL-$version
if [ ! -f CGAL-$version.tar.gz ]; then
- #4.0
- curl -O https://gforge.inria.fr/frs/download.php/30387/CGAL-$version.tar.gz
+ #4.0.2
+ curl -O https://gforge.inria.fr/frs/download.php/31174/CGAL-$version.tar.bz2
+ # 4.0 curl -O https://gforge.inria.fr/frs/download.php/30387/CGAL-$version.tar.gz
# 3.9 curl -O https://gforge.inria.fr/frs/download.php/29125/CGAL-$version.tar.gz
# 3.8 curl -O https://gforge.inria.fr/frs/download.php/28500/CGAL-$version.tar.gz
# 3.7 curl -O https://gforge.inria.fr/frs/download.php/27641/CGAL-$version.tar.gz
fi
- tar xzf CGAL-$version.tar.gz
+ tar jxf CGAL-$version.tar.bz2
cd CGAL-$version
- if [ $2 = use-sys-libs ]; then
+ if [ $2 = use-sys-libs ]; then
cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DCMAKE_BUILD_TYPE=Debug
else
cmake -DCMAKE_INSTALL_PREFIX=$DEPLOYDIR -DGMP_INCLUDE_DIR=$DEPLOYDIR/include -DGMP_LIBRARIES=$DEPLOYDIR/lib/libgmp.so -DGMPXX_LIBRARIES=$DEPLOYDIR/lib/libgmpxx.so -DGMPXX_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_INCLUDE_DIR=$DEPLOYDIR/include -DMPFR_LIBRARIES=$DEPLOYDIR/lib/libmpfr.so -DWITH_CGAL_Qt3=OFF -DWITH_CGAL_Qt4=OFF -DWITH_CGAL_ImageIO=OFF -DBOOST_ROOT=$DEPLOYDIR -DCMAKE_BUILD_TYPE=Debug
@@ -160,12 +168,21 @@ build_glew()
mkdir -p $DEPLOYDIR/lib/pkgconfig
# Fedora 64-bit
- if [ "`ls /usr/lib64 | grep Xmu`" ]; then
- echo "modifying glew makefile for 64 bit machine"
- sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ config/Makefile.linux
- fi
+ if [ -e /usr/lib64 ]; then
+ if [ "`ls /usr/lib64 | grep Xmu`" ]; then
+ echo "modifying glew makefile for 64 bit machine"
+ sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ config/Makefile.linux
+ fi
+ fi
+
+ if [ $CC ]; then
+ if [ $CC = "clang" ]; then
+ echo "modifying glew makefile for clang"
+ sed -i s/\$\(CC\)/clang/ Makefile
+ fi
+ fi
- GLEW_DEST=$DEPLOYDIR make -j$NUMCPU
+ GLEW_DEST=$DEPLOYDIR make -j$NUMCPU
GLEW_DEST=$DEPLOYDIR make install
}
@@ -183,19 +200,39 @@ build_opencsg()
sed -ibak s/example// opencsg.pro # examples might be broken without GLUT
# Fedora 64-bit
- if [ "`ls /usr/lib64 | grep Xmu`" ]; then
- echo "modifying opencsg makefile for 64 bit machine"
- sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile
- fi
+ if [ -e /usr/lib64 ]; then
+ if [ "`ls /usr/lib64 | grep Xmu`" ]; then
+ echo "modifying opencsg makefile for 64 bit machine"
+ sed -ibak s/"\-lXmu"/"\-L\/usr\/lib64\/libXmu.so.6"/ src/Makefile
+ fi
+ fi
+
+ if [ `uname | grep FreeBSD` ]; then
+ sed -ibak s/X11R6/local/g src/Makefile
+ fi
if [ "`command -v qmake-qt4`" ]; then
- qmake-qt4
+ OPENCSG_QMAKE=qmake-qt4
else
- qmake
+ OPENCSG_QMAKE=qmake
fi
+
+ if [ $CXX ]; then
+ if [ $CXX = "clang++" ]; then
+ cd $BASEDIR/src/OpenCSG-$version/src
+ $OPENCSG_QMAKE
+ cd $BASEDIR/src/OpenCSG-$version
+ $OPENCSG_QMAKE
+ fi
+ else
+ $OPENCSG_QMAKE
+ fi
+
make
+
cp -av lib/* $DEPLOYDIR/lib
cp -av include/* $DEPLOYDIR/include
+ cd $OPENSCADDIR
}
build_eigen()
@@ -235,7 +272,7 @@ if [ ! $NUMCPU ]; then
fi
if [ ! -d $BASEDIR/bin ]; then
- mkdir --parents $BASEDIR/bin
+ mkdir -p $BASEDIR/bin
fi
echo "Using basedir:" $BASEDIR
@@ -263,7 +300,7 @@ fi
# (They can be built singly here by passing a command line arg to the script)
if [ $1 ]; then
if [ $1 = "cgal-use-sys-libs" ]; then
- build_cgal 4.0 use-sys-libs
+ build_cgal 4.0.2 use-sys-libs
exit
fi
if [ $1 = "opencsg" ]; then
@@ -283,7 +320,7 @@ build_gmp 5.0.5
build_mpfr 3.1.1
build_boost 1.47.0
# NB! For CGAL, also update the actual download URL in the function
-build_cgal 4.0
+build_cgal 4.0.2
build_glew 1.7.0
build_opencsg 1.3.2
@@ -0,0 +1,6 @@
+# run with '. ./scripts/setenv-freebsdbuild.sh'
+
+# use in conjuction with freebsd-build-dependencies.sh
+
+QMAKESPEC=freebsd-g++
+QTDIR=/usr/local/share/qt4
@@ -0,0 +1,12 @@
+# build dependencies and/or openscad on linux with the clang compiler
+
+export CC=clang
+export CXX=clang++
+export QMAKESPEC=unsupported/linux-clang
+
+echo CC has been modified: $CC
+echo CXX has been modified: $CXX
+echo QMAKESPEC has been modified: $QMAKESPEC
+
+. ./scripts/setenv-linbuild.sh
+
@@ -3,9 +3,9 @@
# run this file with 'source setenv-linbuild.sh' every time you re-login
# and want to build or run openscad against custom libraries installed
-# into BASEDIR.
+# into BASEDIR.
-# copy this file to your .bashrc if desired.
+# copy this file to your .bashrc if desired.
if [ ! $BASEDIR ]; then
BASEDIR=$HOME/openscad_deps
View
@@ -67,6 +67,9 @@ Preferences::Preferences(QWidget *parent) : QMainWindow(parent)
connect(this->fontSize, SIGNAL(currentIndexChanged(const QString&)),
this, SLOT(on_fontSize_editTextChanged(const QString &)));
+ // reset GUI fontsize if fontSize->addItem emitted signals that changed it.
+ this->fontSize->setEditText( QString("%1").arg( savedsize ) );
+
// Setup default settings
this->defaultmap["3dview/colorscheme"] = this->colorSchemeChooser->currentItem()->text();
this->defaultmap["advanced/opencsg_show_warning"] = true;
View
@@ -1,4 +1,5 @@
#include "editor.h"
+#include "Preferences.h"
#ifndef _QCODE_EDIT_
void Editor::indentSelection()
@@ -70,4 +71,40 @@ void Editor::uncommentSelection()
cursor.setPosition(p2, QTextCursor::KeepAnchor);
setTextCursor(cursor);
}
+
+void Editor::zoomIn()
+{
+ // See also QT's implementation in QEditor.cpp
+ QSettings settings;
+ QFont tmp_font = this->font() ;
+ if ( font().pointSize() >= 1 )
+ tmp_font.setPointSize( 1 + font().pointSize() );
+ else
+ tmp_font.setPointSize( 1 );
+ settings.setValue("editor/fontsize", tmp_font.pointSize());
+ this->setFont( tmp_font );
+}
+
+void Editor::zoomOut()
+{
+ QSettings settings;
+ QFont tmp_font = this->font();
+ if ( font().pointSize() >= 2 )
+ tmp_font.setPointSize( -1 + font().pointSize() );
+ else
+ tmp_font.setPointSize( 1 );
+ settings.setValue("editor/fontsize", tmp_font.pointSize());
+ this->setFont( tmp_font );
+}
+
+void Editor::wheelEvent ( QWheelEvent * event )
+{
+ if (event->modifiers() == Qt::ControlModifier) {
+ if (event->delta() > 0 )
+ zoomIn();
+ else if (event->delta() < 0 )
+ zoomOut();
+ }
+}
+
#endif
View
@@ -1,6 +1,7 @@
#include <QObject>
#include <QString>
#include <QWidget>
+#include <QWheelEvent>
#ifdef _QCODE_EDIT_
#include <qeditor.h>
@@ -24,12 +25,16 @@ public slots:
#else
Editor(QWidget *parent) : QTextEdit(parent) { setAcceptRichText(false); }
public slots:
+ void zoomIn();
+ void zoomOut();
void setLineWrapping(bool on) { if(on) setWordWrapMode(QTextOption::WrapAnywhere); }
void setContentModified(bool y) { document()->setModified(y); }
bool isContentModified() { return document()->isModified(); }
void indentSelection();
void unindentSelection();
void commentSelection();
void uncommentSelection();
+private:
+ void wheelEvent ( QWheelEvent * event );
#endif
};
View
@@ -53,7 +53,7 @@ a time, to avoid confusion.
#error CGAL library missing or version too old. See README.md. To force compile, run qmake CONFIG=skip-version-check
#else
-#if CGAL_VERSION_NR < 1040001000
+#if CGAL_VERSION_NR < 1040021000
#warning "======================="
#warning "."
#warning "."

0 comments on commit 548a568

Please sign in to comment.