Skip to content
This repository
Browse code

Added OpenGL to CMake build system, but remained commented out in add…

…ons/CMakeLists.txt as it doesn't build on OSX for some reason. Will check more into it later.
  • Loading branch information...
commit 8c71756949d62639634ee84bd081de7ca7994e37 1 parent 317a683
Jeremy Tregunna authored May 09, 2010
2  addons/CMakeLists.txt
@@ -76,7 +76,7 @@ add_subdirectory(NotificationCenter)
76 76
 #add_subdirectory(ObjcBridge)
77 77
 add_subdirectory(Obsidian)
78 78
 add_subdirectory(Ogg)
79  
-#add_subdirectory(OpenGL)
  79
+#add_subdirectory(OpenGL) # XXX: Needs some attention
80 80
 #add_subdirectory(PortAudio)
81 81
 #add_subdirectory(PostgreSQL)
82 82
 #add_subdirectory(Postgres)
50  addons/OpenGL/CMakeLists.txt
... ...
@@ -0,0 +1,50 @@
  1
+# Base Io build system
  2
+# Written by Jeremy Tregunna <jeremy.tregunna@me.com>
  3
+#
  4
+# Builds the OpenGL addon
  5
+
  6
+# Find curses
  7
+find_package(OpenGL)
  8
+
  9
+# Create the _build bundle hierarchy if needed.
  10
+make_build_bundle(_build)
  11
+
  12
+# Did we find curses? if so, set up the targets and all the support
  13
+# variables.
  14
+if(OPENGL_FOUND AND OPENGL_GLU_FOUND)
  15
+	# Output our dynamic library to the top-level _build hierarchy
  16
+	set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR}/_build/dll)
  17
+
  18
+	# Additional include directories
  19
+	include_directories(
  20
+		${OPENGL_INCLUDE_DIR}
  21
+		${CMAKE_CURRENT_SOURCE_DIR}/../Box/source
  22
+		${CMAKE_CURRENT_SOURCE_DIR}/../Image/source
  23
+	)
  24
+
  25
+	# Generate the IoOpenGLInit.c file.
  26
+	# Argument SHOULD ALWAYS be the exact name of the addon, case is
  27
+	# important.
  28
+	generate_ioinit(OpenGL)
  29
+
  30
+	# Our library sources.
  31
+	set(SRCS
  32
+		"${CMAKE_CURRENT_SOURCE_DIR}/source/IoBox_gl.c"
  33
+		"${CMAKE_CURRENT_SOURCE_DIR}/source/IoGLScissor.c"
  34
+		"${CMAKE_CURRENT_SOURCE_DIR}/source/IoGLU.c"
  35
+		"${CMAKE_CURRENT_SOURCE_DIR}/source/IoGLUQuadric.c"
  36
+		"${CMAKE_CURRENT_SOURCE_DIR}/source/IoGLUT.c"
  37
+		"${CMAKE_CURRENT_SOURCE_DIR}/source/IoVector_gl.c"
  38
+		"${CMAKE_CURRENT_SOURCE_DIR}/source/IoOpenGL.c"
  39
+		"${CMAKE_CURRENT_SOURCE_DIR}/source/IoOpenGLInit.c"
  40
+	)
  41
+
  42
+	# Now build the shared library
  43
+	add_library(IoOpenGL SHARED ${SRCS})
  44
+	add_dependencies(IoOpenGL iovmall)
  45
+	target_link_libraries(IoOpenGL iovmall ${OPENGL_LIBRARIES})
  46
+
  47
+	# Install the addon to our global addons hierarchy.
  48
+	install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons)
  49
+	install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/_build DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/io/addons/OpenGL)
  50
+endif(OPENGL_FOUND AND OPENGL_GLU_FOUND)

0 notes on commit 8c71756

Please sign in to comment.
Something went wrong with that request. Please try again.