+
+
+### Sources
+
+set(LUGARU_SRCS
+ ${SRCDIR}/Frustum.cpp
+ ${SRCDIR}/Account.cpp
+ ${SRCDIR}/ConsoleCmds.cpp
+ ${SRCDIR}/Game.cpp
+ ${SRCDIR}/GameDraw.cpp
+ ${SRCDIR}/GameInitDispose.cpp
+ ${SRCDIR}/GameTick.cpp
+ ${SRCDIR}/Globals.cpp
+ ${SRCDIR}/Lights.cpp
+ ${SRCDIR}/Menu.cpp
+ ${SRCDIR}/Models.cpp
+ ${SRCDIR}/Objects.cpp
+ ${SRCDIR}/pack.c
+ ${SRCDIR}/Person.cpp
+ ${SRCDIR}/private.c
+ ${SRCDIR}/Quaternions.cpp
+ ${SRCDIR}/Skeleton.cpp
+ ${SRCDIR}/Skybox.cpp
+ ${SRCDIR}/Sprite.cpp
+ ${SRCDIR}/Terrain.cpp
+ ${SRCDIR}/Texture.cpp
+ ${SRCDIR}/Text.cpp
+ ${SRCDIR}/ImageIO.cpp
+ ${SRCDIR}/unpack.c
+ ${SRCDIR}/Weapons.cpp
+ ${SRCDIR}/OpenGL_Windows.cpp
+ ${SRCDIR}/openal_wrapper.cpp
+ ${SRCDIR}/Input.cpp
+ ${SRCDIR}/Settings.cpp
+ ${SRCDIR}/Stereo.cpp
+ ${SRCDIR}/Animation.cpp
+ ${SRCDIR}/Sounds.cpp
+ ${SRCDIR}/Awards.cpp
+)
+
+set(LUGARU_H
+ ${SRCDIR}/Frustum.h
+ ${SRCDIR}/Account.h
+ ${SRCDIR}/ConsoleCmds.h
+ ${SRCDIR}/Game.h
+ ${SRCDIR}/Lights.h
+ ${SRCDIR}/Menu.h
+ ${SRCDIR}/Models.h
+ ${SRCDIR}/Objects.h
+ ${SRCDIR}/Person.h
+ ${SRCDIR}/PhysicsMath.h
+ ${SRCDIR}/Quaternions.h
+ ${SRCDIR}/Random.h
+ ${SRCDIR}/Skeleton.h
+ ${SRCDIR}/Skybox.h
+ ${SRCDIR}/Sprite.h
+ ${SRCDIR}/ImageIO.h
+ ${SRCDIR}/Terrain.h
+ ${SRCDIR}/Texture.h
+ ${SRCDIR}/Text.h
+ ${SRCDIR}/Weapons.h
+ ${SRCDIR}/Input.h
+ ${SRCDIR}/binio.h
+ ${SRCDIR}/openal_wrapper.h
+ ${SRCDIR}/gamegl.h
+ ${SRCDIR}/glstubs.h
+ ${SRCDIR}/private.h
+ ${SRCDIR}/Settings.h
+ ${SRCDIR}/Stereo.h
+ ${SRCDIR}/Animation.h
+ ${SRCDIR}/Sounds.h
+)
+
+if(UNIX)
+ set(LUGARU_SRCS
+ ${LUGARU_SRCS}
+ ${SRCDIR}/MacCompatibility.cpp
+ )
+ set(LUGARU_H
+ ${LUGARU_H}
+ ${SRCDIR}/MacCompatibility.h
+ )
+endif(UNIX)
+
+if(WIN32)
+ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
+ COMMAND ${CMAKE_RC_COMPILER}
+ -I${SRCDIR}/win-res
+ -o ${CMAKE_CURRENT_BINARY_DIR}/lugaru_resource.obj
+ -i${SRCDIR}/win-res/Lugaru.rc
+ DEPENDS ${SRCDIR}/win-res/Lugaru.rc
+ )
+
+ # FIXME: get rid of this.
+ set(LUGARU_SRCS
+ ${LUGARU_SRCS}
+ ${SRCDIR}/WinDefs.cpp)
+
+ set(LUGARU_H
+ ${LUGARU_H}
+ ${SRCDIR}/WinDefs.h
+ ${SRCDIR}/win-res/resource.h)
+endif(WIN32)
+
+if(APPLE)
+ set(PLATFORM_LIBS "-framework Carbon -framework Cocoa -framework OpenGL -framework OpenAL")
+endif(APPLE)
+
+
+### Dependencies
+
+find_package(OpenGL REQUIRED)
+
+# Windows is funky about OpenAL detection
+if(WIN32)
+ pkg_check_modules(OPENAL openal REQUIRED)
+ set(OPENAL_LIBRARY ${OPENAL_LIBRARIES})
+else(WIN32)
+ find_package(OpenAL REQUIRED)
+endif(WIN32)
+
+find_package(sdl2 REQUIRED)