2010-11-08 23:04:33 +01:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|
|
|
PROJECT(otclient)
|
2010-11-18 23:13:35 +01:00
|
|
|
|
2010-11-21 22:48:58 +01:00
|
|
|
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
|
|
|
|
|
2010-11-18 23:13:35 +01:00
|
|
|
# find needed packages
|
|
|
|
SET(Boost_USE_STATIC_LIBS ON)
|
2011-04-07 11:36:02 +02:00
|
|
|
SET(Boost_USE_MULTITHREADED ON)
|
|
|
|
FIND_PACKAGE(Boost COMPONENTS system regex REQUIRED)
|
2010-11-18 23:13:35 +01:00
|
|
|
FIND_PACKAGE(OpenGL REQUIRED)
|
|
|
|
FIND_PACKAGE(Lua51 REQUIRED)
|
2010-11-21 22:48:58 +01:00
|
|
|
FIND_PACKAGE(YamlCpp REQUIRED)
|
|
|
|
FIND_PACKAGE(PhysFS REQUIRED)
|
|
|
|
FIND_PACKAGE(PNG REQUIRED)
|
2010-11-18 23:13:35 +01:00
|
|
|
|
|
|
|
# choose a default build type if not specified
|
|
|
|
IF(NOT CMAKE_BUILD_TYPE)
|
|
|
|
SET(CMAKE_BUILD_TYPE RelWithDebInfo)
|
|
|
|
ENDIF(NOT CMAKE_BUILD_TYPE)
|
|
|
|
MESSAGE(STATUS "BUILD TYPE: " ${CMAKE_BUILD_TYPE})
|
|
|
|
|
|
|
|
# setup compiler options
|
|
|
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
2011-04-02 21:59:49 +02:00
|
|
|
SET(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -std=c++0x")
|
2010-11-18 23:13:35 +01:00
|
|
|
SET(CMAKE_CXX_FLAGS_DEBUG "-O1 -g -ggdb -fno-inline")
|
|
|
|
SET(CMAKE_CXX_FLAGS_RELEASE "-O2 -Wl,-s")
|
|
|
|
SET(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-O2 -g")
|
2010-11-21 22:48:58 +01:00
|
|
|
SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,--as-needed")
|
2010-11-18 23:13:35 +01:00
|
|
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(
|
2010-11-21 22:48:58 +01:00
|
|
|
${Boost_INCLUDE_DIRS}
|
|
|
|
${LUA_INCLUDE_DIRS}
|
|
|
|
${YAMLCPP_INCLUDE_DIRS}
|
|
|
|
${PHYSFS_INCLUDE_DIRS}
|
|
|
|
${PNG_INCLUDE_DIRS})
|
2010-11-18 23:13:35 +01:00
|
|
|
|
|
|
|
LINK_DIRECTORIES(
|
2010-11-21 22:48:58 +01:00
|
|
|
${Boost_LIBRARY_DIRS}
|
|
|
|
${LUA_LIBRARY_DIRS}
|
|
|
|
${PHYSFS_LIBRARY_DIRS}
|
|
|
|
${YAMLCPP_LIBRARY_DIRS}
|
|
|
|
${PNG_LIBRARY_DIRS})
|
2010-11-18 23:13:35 +01:00
|
|
|
|
|
|
|
# setup definitions
|
|
|
|
ADD_DEFINITIONS(-D_REENTRANT)
|
|
|
|
|
|
|
|
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
ADD_DEFINITIONS(-D_DEBUG)
|
|
|
|
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
|
|
|
|
|
|
|
SET(SOURCES
|
2011-03-19 00:49:30 +01:00
|
|
|
# game sources
|
|
|
|
src/main.cpp
|
2010-11-23 16:30:43 +01:00
|
|
|
src/menustate.cpp
|
2011-04-08 07:10:00 +02:00
|
|
|
src/teststate.cpp
|
2011-04-07 11:36:02 +02:00
|
|
|
|
2011-03-19 00:49:30 +01:00
|
|
|
# framework sources
|
2011-04-08 20:29:59 +02:00
|
|
|
src/framework/image.cpp
|
2011-04-08 11:50:26 +02:00
|
|
|
src/framework/borderedimage.cpp
|
2011-04-08 07:10:00 +02:00
|
|
|
src/framework/dispatcher.cpp
|
2011-02-08 23:48:26 +01:00
|
|
|
src/framework/framebuffer.cpp
|
2011-04-06 21:46:58 +02:00
|
|
|
src/framework/font.cpp
|
2011-04-02 21:59:49 +02:00
|
|
|
src/framework/fonts.cpp
|
2011-02-08 23:48:26 +01:00
|
|
|
src/framework/textureloader.cpp
|
|
|
|
src/framework/texture.cpp
|
2011-04-06 21:46:58 +02:00
|
|
|
src/framework/textures.cpp
|
|
|
|
src/framework/configs.cpp
|
|
|
|
src/framework/resources.cpp
|
2011-02-08 23:48:26 +01:00
|
|
|
src/framework/engine.cpp
|
|
|
|
src/framework/graphics.cpp
|
|
|
|
src/framework/logger.cpp
|
2011-04-07 10:42:57 +02:00
|
|
|
src/framework/util.cpp
|
|
|
|
|
2011-04-08 07:10:00 +02:00
|
|
|
# ui
|
2011-04-09 21:07:35 +02:00
|
|
|
src/framework/ui/anchorlayout.cpp
|
2011-04-08 07:10:00 +02:00
|
|
|
src/framework/ui/uielement.cpp
|
2011-04-09 01:20:44 +02:00
|
|
|
src/framework/ui/uielementskin.cpp
|
2011-04-09 21:07:35 +02:00
|
|
|
src/framework/ui/uibuttonskin.cpp
|
2011-04-08 07:10:00 +02:00
|
|
|
src/framework/ui/uicontainer.cpp
|
2011-04-09 01:20:44 +02:00
|
|
|
src/framework/ui/uiskins.cpp
|
2011-04-08 07:10:00 +02:00
|
|
|
src/framework/ui/uipanel.cpp
|
|
|
|
src/framework/ui/uibutton.cpp
|
|
|
|
src/framework/ui/uilabel.cpp
|
|
|
|
|
|
|
|
# network
|
2011-04-07 10:42:57 +02:00
|
|
|
src/framework/net/connection.cpp
|
|
|
|
src/framework/net/connections.cpp)
|
2010-11-18 23:13:35 +01:00
|
|
|
|
|
|
|
IF(WIN32)
|
2011-02-08 23:48:26 +01:00
|
|
|
SET(SOURCES ${SOURCES} src/framework/win32platform.cpp)
|
2011-04-07 11:36:02 +02:00
|
|
|
SET(ADDITIONAL_LIBRARIES ws2_32)
|
|
|
|
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
|
2010-11-18 23:13:35 +01:00
|
|
|
ELSE(WIN32)
|
2011-02-08 23:48:26 +01:00
|
|
|
SET(SOURCES ${SOURCES} src/framework/x11platform.cpp)
|
2011-04-07 11:36:02 +02:00
|
|
|
SET(ADDITIONAL_LIBRARIES pthread GLU)
|
2010-11-18 23:13:35 +01:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
|
|
|
# target executable
|
|
|
|
ADD_EXECUTABLE(otclient ${SOURCES})
|
|
|
|
|
|
|
|
# target link libraries
|
|
|
|
TARGET_LINK_LIBRARIES(otclient
|
2010-11-21 22:48:58 +01:00
|
|
|
${Boost_LIBRARIES}
|
|
|
|
${OPENGL_LIBRARY}
|
|
|
|
${LUA51_LIBRARY}
|
|
|
|
${YAMLCPP_LIBRARY}
|
|
|
|
${PHYSFS_LIBRARY}
|
2011-04-07 11:36:02 +02:00
|
|
|
${PNG_LIBRARY}
|
|
|
|
${ADDITIONAL_LIBRARIES})
|