1CONFIG += debug
2CONFIG -= qt
3debug: DEFINES += DEBUG
4
5TEMPLATE = app
6
7INCLUDEPATH += ../src ../src/libtess2/Include
8DEPENDPATH += ../src
9
10# Handle custom library location.
11# Used when manually installing 3rd party libraries
12isEmpty(OPENSCAD_LIBDIR) OPENSCAD_LIBDIR = $$(OPENSCAD_LIBRARIES)
13macx:isEmpty(OPENSCAD_LIBDIR) {
14  exists(/opt/local):exists(/usr/local/Cellar) {
15    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>")
16  } else {
17    exists(/opt/local) {
18      #Default to MacPorts on Mac OS X
19      message("Automatically searching for libraries in /opt/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>")
20      OPENSCAD_LIBDIR = /opt/local
21    } else:exists(/usr/local/Cellar) {
22      message("Automatically searching for libraries in /usr/local. To override, use qmake OPENSCAD_LIBDIR=<prefix>")
23      OPENSCAD_LIBDIR = /usr/local
24    }
25  }
26}
27!isEmpty(OPENSCAD_LIBDIR) {
28  QMAKE_INCDIR = $$OPENSCAD_LIBDIR/include
29  QMAKE_LIBDIR = $$OPENSCAD_LIBDIR/lib
30}
31
32TARGET = decompose
33mac {
34  CONFIG -= app_bundle
35}
36
37macx {
38  # Mac needs special care to link against the correct C++ library
39  # We attempt to auto-detect it by inspecting Boost
40  dirs = $${BOOSTDIR} $${QMAKE_LIBDIR}
41  for(dir, dirs) {
42    system(grep -q __112basic_string $${dir}/libboost_thread* >& /dev/null) {
43      message("Detected libc++-linked boost in $${dir}")
44      CONFIG += libc++
45    }
46  }
47
48  libc++ {
49    QMAKE_CXXFLAGS += -stdlib=libc++
50    QMAKE_LFLAGS += -stdlib=libc++
51    QMAKE_OBJECTIVE_CFLAGS += -stdlib=libc++
52    # libc++ on requires Mac OS X 10.7+
53    QMAKE_MACOSX_DEPLOYMENT_TARGET = 10.7
54  }
55}
56
57*g++* {
58  # See Dec 2011 OpenSCAD mailing list, re: CGAL/GCC bugs.
59  QMAKE_CXXFLAGS *= -fno-strict-aliasing
60  QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-local-typedefs # ignored before 4.8
61  # use of 'auto'
62  QMAKE_CXXFLAGS += -std=c++11
63}
64
65*clang* {
66  # http://llvm.org/bugs/show_bug.cgi?id=9182
67  QMAKE_CXXFLAGS_WARN_ON += -Wno-overloaded-virtual
68  # disable enormous amount of warnings about CGAL / boost / etc
69  QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-parameter
70  QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-variable
71  QMAKE_CXXFLAGS_WARN_ON += -Wno-unused-function
72  QMAKE_CXXFLAGS_WARN_ON += -Wno-c++11-extensions
73  # might want to actually turn this on once in a while
74  QMAKE_CXXFLAGS_WARN_ON += -Wno-sign-compare
75}
76
77# Application configuration
78CONFIG += cgal
79CONFIG += boost
80CONFIG += eigen
81CONFIG += gettext
82
83mac: {
84   LIBS += -framework OpenGL
85} else {
86   LIBS += -lGL
87}
88
89
90include(../common.pri)
91
92HEADERS += ../src/cgal.h \
93           ../src/cgalutils.h \
94           ../src/linalg.h \
95           ../src/grid.h \
96           ../src/hash.h \
97           ../src/polyset.h \
98           ../src/polyset-utils.h \
99           ../src/printutils.h \
100           ../src/GeometryUtils.h \
101           ../src/libtess2/Include/tesselator.h \
102           ../src/libtess2/Source/bucketalloc.h \
103           ../src/libtess2/Source/dict.h \
104           ../src/libtess2/Source/geom.h \
105           ../src/libtess2/Source/mesh.h \
106           ../src/libtess2/Source/priorityq.h \
107           ../src/libtess2/Source/sweep.h \
108           ../src/libtess2/Source/tess.h
109
110SOURCES += decompose.cpp \
111           ../src/polygon2d.cc \
112           ../src/polygon2d-CGAL.cc \
113           ../src/CGAL_Nef_polyhedron.cc \
114           ../src/cgalutils.cc \
115           ../src/cgalutils-applyops.cc \
116           ../src/cgalutils-tess.cc \
117           ../src/cgalutils-polyhedron.cc \
118           ../src/polyset.cc \
119           ../src/polyset-gl.cc \
120           ../src/GeometryUtils.cc \
121           ../src/svg.cc \
122           ../src/hash.cc \
123           ../src/node.cc \
124           ../src/export.cc \
125           ../src/export_stl.cc \
126           ../src/export_amf.cc \
127           ../src/export_off.cc \
128           ../src/export_dxf.cc \
129           ../src/export_svg.cc \
130           ../src/export_nef.cc \
131           ../src/polyset-utils.cc \
132           ../src/progress.cc \
133           ../src/printutils.cc \
134           ../src/libtess2/Source/bucketalloc.c \
135           ../src/libtess2/Source/dict.c \
136           ../src/libtess2/Source/geom.c \
137           ../src/libtess2/Source/mesh.c \
138           ../src/libtess2/Source/priorityq.c \
139           ../src/libtess2/Source/sweep.c \
140           ../src/libtess2/Source/tess.c
141