Adapt to using CONFIG+=c++11

master
Marius Kintel 2014-06-08 00:03:06 -04:00
parent 7f782832d7
commit 35222064c1
1 changed files with 20 additions and 34 deletions

View File

@ -55,40 +55,23 @@ isEmpty(OPENSCAD_LIBDIR) OPENSCAD_LIBDIR = $$(OPENSCAD_LIBRARIES)
}
else {
macx {
exists(/opt/local):exists(/usr/local/Cellar) {
error("It seems you might have libraries in both /opt/local and /usr/local. Please specify which one to use with qmake OPENSCAD_LIBDIR=<prefix>");
} else {
exists(/opt/local) {
#Default to MacPorts on Mac OS X
message("Automatically searching for libraries in /opt/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>");
QMAKE_INCDIR = /opt/local/include
QMAKE_LIBDIR = /opt/local/lib
} else:exists(/usr/local/Cellar) {
message("Automatically searching for libraries in /usr/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>");
QMAKE_INCDIR = /usr/local/include
QMAKE_LIBDIR = /usr/local/lib
}
}
exists(/opt/local):exists(/usr/local/Cellar) {
error("It seems you might have libraries in both /opt/local and /usr/local. Please specify which one to use with qmake OPENSCAD_LIBDIR=<prefix>")
} else {
exists(/opt/local) {
#Default to MacPorts on Mac OS X
message("Automatically searching for libraries in /opt/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>")
QMAKE_INCDIR = /opt/local/include
QMAKE_LIBDIR = /opt/local/lib
} else:exists(/usr/local/Cellar) {
message("Automatically searching for libraries in /usr/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>")
QMAKE_INCDIR = /usr/local/include
QMAKE_LIBDIR = /usr/local/lib
}
}
}
}
macx {
dirs = $${BOOSTDIR} $${QMAKE_LIBDIR}
for(dir, dirs) {
system(grep -q __112basic_string $${dir}/libboost_thread* >& /dev/null) {
message("Detected libc++-linked boost in $${dir}");
# In that case, we will also need to link against libc++
QMAKE_CXXFLAGS += -stdlib=libc++
QMAKE_LFLAGS += -stdlib=libc++
QMAKE_OBJECTIVE_CFLAGS += -stdlib=libc++
# And libc++ requires 10.7
QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
}
}
}
# add CONFIG+=deploy to the qmake command-line to make a deployment build
deploy {
message("Building deployment version")
@ -108,9 +91,12 @@ macx {
QMAKE_BUNDLE_DATA += APP_RESOURCES
LIBS += -framework Cocoa -framework ApplicationServices
system(grep -q __112basic_string $$QMAKE_LIBDIR/libboost_thread*) {
message("Boost using libc++ detected - building with C++11")
CONFIG += c++11
dirs = $${BOOSTDIR} $${QMAKE_LIBDIR}
for(dir, dirs) {
system(grep -q __112basic_string $${dir}/libboost_thread* >& /dev/null) {
message("Detected libc++-linked boost in $${dir}")
CONFIG += c++11
}
}
c++11 {