summaryrefslogtreecommitdiff
path: root/patches/OpenCSG-1.3.2-MacOSX-port.patch
blob: 72623072307f8690fb3d75caff65b1c9e25a897e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
diff --git a/example/example.pro b/example/example.pro
index 8891a28..5cb5e81 100644
--- a/example/example.pro
+++ b/example/example.pro
@@ -2,9 +2,16 @@ TEMPLATE	= app
 TARGET		= opencsgexample
 
 CONFIG	 	+= opengl warn_on release
-INCLUDEPATH += ../glew/include ../include
-
-LIBS        += -L../lib -lopencsg -lglut -L../glew/lib -lGLEW
+INCLUDEPATH     += ../include
+LIBS            += -L../lib -lopencsg -lGLEW
+macx {
+  INCLUDEPATH   += /opt/local/include
+  LIBS          += -framework GLUT -L/opt/local/lib
+}
+else {
+  INCLUDEPATH   += ../glew/include
+  LIBS          += -lglut -L../glew/lib
+}
 
 HEADERS		= displaylistPrimitive.h
 SOURCES		= displaylistPrimitive.cpp main.cpp
diff --git a/opencsg.pro b/opencsg.pro
index b56e622..5cf2d6d 100644
--- a/opencsg.pro
+++ b/opencsg.pro
@@ -1,2 +1,2 @@
 TEMPLATE = subdirs
-SUBDIRS  = src example
+SUBDIRS  = src
diff --git a/src/src.pro b/src/src.pro
index 4843a12..04d3f4d 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,10 +1,32 @@
 TEMPLATE	= lib
 TARGET		= opencsg
 VERSION     = 1.3.2
-DESTDIR     = ../lib
 
 CONFIG		+= opengl warn_on release
-INCLUDEPATH += ../include ../glew/include ../
+INCLUDEPATH += ../include ../
+CONFIG -= qt
+
+# Optionally specify deployment location using the 
+# OPENSCAD_LIBRARIES env. variable
+OPENSCAD_LIBDIR = $$(OPENSCAD_LIBRARIES)
+
+!isEmpty(OPENSCAD_LIBDIR) {
+  message("Deploy")
+  INSTALLDIR     = $$OPENSCAD_LIBDIR
+  INCLUDEPATH += $$OPENSCAD_LIBDIR/include
+  LIBS += -L$$OPENSCAD_LIBDIR/lib -lGLEW
+  CONFIG += absolute_library_soname
+  headers.files = ../include/opencsg.h
+  headers.path = $$INSTALLDIR/include
+  INSTALLS += target headers
+  target.path = $$INSTALLDIR/lib
+}
+else {
+  DESTDIR = ../lib
+  INCLUDEPATH += ../glew/include
+  INSTALLS += target
+  target.path = $$DESTDIR
+}
 
 HEADERS		= ../include/opencsg.h \
 		  opencsgConfig.h \
contact: Jan Huwald // Impressum