structure changes

This commit is contained in:
gmueller 2011-01-17 21:50:50 +01:00
parent aff6366561
commit 3f00ee4f31
22 changed files with 41 additions and 80 deletions

View File

@ -1,11 +1,31 @@
cmake_minimum_required (VERSION 2.6)
project (GREMLIN C CXX)
if (MSVC)
add_definitions(/D_USE_MATH_DEFINES)
endif(MSVC)
if (WIN32)
set(PLATFORM_LIBRARIES ws2_32 winmm)
endif(WIN32)
if(UNIX)
set(PLATFORM_LIBRARIES pthread)
endif(UNIX)
include_directories (${GREMLIN_SOURCE_DIR}/libs/glfw/include)
include_directories (${GREMLIN_SOURCE_DIR}/libs/spark/include)
include_directories (${GREMLIN_SOURCE_DIR}/libs/enet/include)
find_package(OpenGL)
add_subdirectory (libs/enet)
add_subdirectory (src/common)
add_subdirectory (src/server)
if (OPENGL_FOUND)
add_subdirectory (libs/glfw)
add_subdirectory (libs/spark)
add_subdirectory (src/client)
endif(OPENGL_FOUND)
add_subdirectory (libs/enet)
add_subdirectory (src)

View File

@ -1,77 +0,0 @@
include_directories (${GREMLIN_SOURCE_DIR}/libs/glfw/include)
include_directories (${GREMLIN_SOURCE_DIR}/libs/spark/include)
include_directories (${GREMLIN_SOURCE_DIR}/libs/enet/include)
include_directories (${GREMLIN_SOURCE_DIR}/src)
if (MSVC)
add_definitions(/D_USE_MATH_DEFINES)
endif(MSVC)
if (WIN32)
set(PLATFORM_LIBRARIES ws2_32 winmm)
endif(WIN32)
if(UNIX)
set(PLATFORM_LIBRARIES pthread)
endif(UNIX)
if (OPENGL_FOUND)
SET(VIDEO_SOURCES Explosion oglfont Client)
# define executable
add_executable( gremlin
Application
main
game
Time
Network
${VIDEO_SOURCES}
)
add_dependencies( gremlin
enet
)
target_link_libraries(gremlin
enet ${PLATFORM_LIBRARIES}
)
endif(OPENGL_FOUND)
# define executable
add_executable( gremlin_dedicated
Application
server
game
Time
Network
)
add_dependencies( gremlin_dedicated
enet
)
target_link_libraries(gremlin_dedicated
enet ${PLATFORM_LIBRARIES}
)
if (OPENGL_FOUND)
# set dependencies
add_dependencies( gremlin
glfw spark
)
add_definitions(-DENABLE_VIDEO)
if(UNIX)
target_link_libraries(gremlin
GL GLU X11 Xrandr
)
endif(UNIX)
target_link_libraries(gremlin
glfw spark ${OPENGL_LIBRARIES}
)
endif(OPENGL_FOUND)

19
src/client/CMakeLists.txt Normal file
View File

@ -0,0 +1,19 @@
include_directories (${GREMLIN_SOURCE_DIR}/src/common)
# define executable
add_executable( gremlin
Client
Explosion
main
oglfont
)
add_dependencies( gremlin
common
glfw
spark
)
target_link_libraries(gremlin
common enet glfw spark ${PLATFORM_LIBRARIES} ${OPENGL_LIBRARIES}
)

View File

@ -27,4 +27,3 @@ int main(int argc, const char **argv) {
return 1;
}
}