fixed OpenGL

This commit is contained in:
Gero Müller 2011-01-14 22:02:36 +01:00
parent cd3c163d2a
commit 14e4f4f54c
2 changed files with 8 additions and 9 deletions

View File

@ -1,12 +1,11 @@
cmake_minimum_required (VERSION 2.6)
project (GREMLIN C CXX)
INCLUDE (CheckIncludeFiles)
CHECK_INCLUDE_FILES ("GL/gl.h" ENABLE_VIDEO)
find_package(OpenGL)
if (ENABLE_VIDEO)
if (OPENGL_FOUND)
add_subdirectory (libs/glfw)
add_subdirectory (libs/spark)
endif(ENABLE_VIDEO)
endif(OPENGL_FOUND)
add_subdirectory (libs/enet)
add_subdirectory (src)

View File

@ -1,13 +1,13 @@
if (ENABLE_VIDEO)
if (OPENGL_FOUND)
# find external software
find_package(OpenGL)
# set includes
include_directories (${GREMLIN_SOURCE_DIR}/libs/glfw/include)
include_directories (${GREMLIN_SOURCE_DIR}/libs/spark/include)
SET(VIDEO_SOURCES Explosion oglfont Client)
endif(ENABLE_VIDEO)
endif(OPENGL_FOUND)
include_directories (${GREMLIN_SOURCE_DIR}/libs/enet/include)
include_directories (${GREMLIN_SOURCE_DIR}/src)
@ -55,7 +55,7 @@ target_link_libraries(gremlin_dedicated
enet ${PLATFORM_LIBRARIES}
)
if (ENABLE_VIDEO)
if (OPENGL_FOUND)
# set dependencies
add_dependencies( gremlin
glfw spark
@ -72,4 +72,4 @@ if (ENABLE_VIDEO)
target_link_libraries(gremlin
glfw spark
)
endif(ENABLE_VIDEO)
endif(OPENGL_FOUND)