CMakeLists.txt
branchtrunk
changeset 169 7e9d90724cf8
parent 153 4410cc03dade
child 171 4bf769d41b01
--- a/CMakeLists.txt	Mon Apr 21 04:29:38 2008 -0400
+++ b/CMakeLists.txt	Mon Apr 21 23:35:49 2008 -0400
@@ -8,9 +8,22 @@
 # testparse uses this when I'm looking at memory usage patterns.
 #ADD_DEFINITIONS(-DMOJOSHADER_DEBUG_MALLOC=1)
 
+FIND_PACKAGE(SDL)
+IF(SDL_FOUND)
+    INCLUDE_DIRECTORIES(${SDL_INCLUDE_DIR})
+    ADD_DEFINITIONS(-DFINDERRORS_COMPILE_SHADERS=1)
+    IF(APPLE)
+        ADD_DEFINITIONS(-I/System/Library/Frameworks/OpenGL.framework/Versions/A/Headers)
+        FIND_LIBRARY(OPENGL_LIBRARY OpenGL)
+        MARK_AS_ADVANCED(OPENGL_LIBRARY)
+        SET(EXTRA_LIBS ${OPENGL_LIBRARY})
+
+    ENDIF(APPLE)
+ENDIF(SDL_FOUND)
+
 ADD_EXECUTABLE(testparse testparse.c mojoshader.c)
 ADD_EXECUTABLE(finderrors finderrors.c mojoshader.c)
-TARGET_LINK_LIBRARIES(finderrors pthread)
+TARGET_LINK_LIBRARIES(finderrors pthread ${SDL_LIBRARY} ${EXTRA_LIBS})
 
 # End of CMakeLists.txt ...