Package: sailcut / 1.3.5-2

link_opengl.patch Patch series | download
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
--- sailcut/src/CMakeLists.txt	2010-10-19 23:08:35.000000000 +0200
+++ sailcut/src/CMakeLists.txt	2011-02-28 11:21:57.000000000 +0100
@@ -12,7 +12,16 @@
 add_definitions(-DSAILCUT_DATA_PATH="${SAILCUT_DATA_PATH}")
 add_definitions(-DSAILCUT_DOC_PATH="${SAILCUT_DOC_PATH}")
 if(QT_QTOPENGL_FOUND)
-add_definitions(-DHAVE_QTOPENGL)
+	add_definitions(-DHAVE_QTOPENGL)
+	# FIXME: FindQt4 fails to pick up the dependencies for QtOpenGL
+	# the dependencies for QtOpenGl
+	if(APPLE)
+		set(QT_LIBRARIES ${QT_LIBRARIES} "-framework OpenGL -framework AGL")
+	elseif(WIN32)
+		set(QT_LIBRARIES ${QT_LIBRARIES} -lopengl32 -lglu32)
+	else()
+		set(QT_LIBRARIES ${QT_LIBRARIES} -lGL)
+	endif()
 endif(QT_QTOPENGL_FOUND)
 
 set(sailcut_UIS formhulldefbase.ui formrigdefbase.ui formsaildefbase.ui)
@@ -87,9 +96,6 @@
 add_dependencies(sailcut documentation)
 add_dependencies(sailcut translations)
 if (WIN32)
-	# FIXME: when cross-compiling for mingw32 FindQt4 fails to pick up
-	# the dependencies for QtOpenGl
-	set(QT_LIBRARIES ${QT_LIBRARIES} -lopengl32 -lglu32)
 	set_target_properties(sailcut PROPERTIES LINK_FLAGS "-mwindows")
 endif(WIN32)
 target_link_libraries(sailcut sailcpp geocpp ${QT_LIBRARIES})