63 lines
2 KiB
CMake
63 lines
2 KiB
CMake
cmake_minimum_required(VERSION 2.8)
|
|
|
|
project(onegame)
|
|
|
|
find_package(Boost 1.48 COMPONENTS chrono REQUIRED)
|
|
include_directories(${Boost_INCLUDE_DIRS})
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
include_directories(${OPENGL_INCLUDE_DIR})
|
|
|
|
find_package(SDL REQUIRED)
|
|
include_directories(${SDL_INCLUDE_DIR})
|
|
|
|
set(boost ${Boost_LIBRARIES})
|
|
set(opengl ${OPENGL_LIBRARIES})
|
|
set(sdl ${SDL_LIBRARY})
|
|
set(moggle moggle_xxx)
|
|
if(UNIX)
|
|
set(motor motor)
|
|
set(zlib z)
|
|
set(alure alure)
|
|
set(assimp assimp)
|
|
if(APPLE)
|
|
include_directories("/sw/include/")
|
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -L/sw/lib")
|
|
set(os_libs "-framework Cocoa" "-framework IOKit")
|
|
set(openal "-framework OpenAL")
|
|
else()
|
|
set(openal openal)
|
|
endif()
|
|
else()
|
|
if(MSVC)
|
|
set(motor motor)
|
|
set(assimp assimp)
|
|
set(zlib zlib)
|
|
set(opengl opengl32.lib)
|
|
set(openal openAL32.lib)
|
|
set(alure alure32.lib)
|
|
set(graphics_libs glew32.lib)
|
|
else()
|
|
#Assume were crosscompiling
|
|
set(motor motor)
|
|
set(assimp assimp)
|
|
set(zlib zlib)
|
|
set(os_libs "${os_libs}" "-lwinmm")
|
|
endif()
|
|
endif()
|
|
|
|
include_directories("${PROJECT_SOURCE_DIR}")
|
|
include_directories("${PROJECT_SOURCE_DIR}/..")
|
|
include_directories(SYSTEM "${PROJECT_SOURCE_DIR}/../motor/..")
|
|
include_directories(SYSTEM "${PROJECT_SOURCE_DIR}/../motor/contrib/assimp-3.0.1270/include")
|
|
include_directories(SYSTEM "${PROJECT_SOURCE_DIR}/../motor/contrib/bullet/src")
|
|
include_directories(SYSTEM "${PROJECT_SOURCE_DIR}/../motor/contrib/freetype-gl")
|
|
include_directories(SYSTEM "${PROJECT_SOURCE_DIR}/../motor/contrib/")
|
|
include_directories(SYSTEM "${PROJECT_SOURCE_DIR}/../motor/moggle/include")
|
|
|
|
add_library(onegame_common Base.cpp physics.cpp ai_world.cpp)
|
|
set(all_friggin_libraries onegame_common ${boost} ${motor} ${moggle} ${assimp} ${zlib} ${opengl} ${sdl} ${openal} ${alure} ${graphics_libs} ${os_libs} ${glew})
|
|
|
|
file(GLOB client_sources "client/*.cpp")
|
|
add_executable(client client_main.cpp ${client_sources})
|
|
target_link_libraries(client ${all_friggin_libraries} websockets)
|