build system patch for OpenCSG-1.3.2 for Mac OS X

felipesanches-svg
Marius Kintel 2011-12-30 15:27:23 +01:00
parent a2f8b11ff4
commit 7a044adfb8
1 changed files with 70 additions and 0 deletions

View File

@ -0,0 +1,70 @@
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,31 @@
TEMPLATE = lib
TARGET = opencsg
VERSION = 1.3.2
-DESTDIR = ../lib
CONFIG += opengl warn_on release
-INCLUDEPATH += ../include ../glew/include ../
+INCLUDEPATH += ../include ../
+
+# Optionally specify deployment location using the
+# MACOSX_DEPLOY_DIR env. variable
+DEPLOYDIR = $$(MACOSX_DEPLOY_DIR)
+
+!isEmpty(DEPLOYDIR) {
+ message("Deploy")
+ INSTALLDIR = $$(MACOSX_DEPLOY_DIR)
+ INCLUDEPATH += $$(MACOSX_DEPLOY_DIR)/include
+ LIBS += -L$$(MACOSX_DEPLOY_DIR)/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 \