2010-11-08 23:04:33 +01:00
|
|
|
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
|
|
|
PROJECT(otclient)
|
2010-11-18 23:13:35 +01:00
|
|
|
|
2011-05-15 21:19:41 +02:00
|
|
|
# setup custom cmake modules path
|
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-05-01 20:47:35 +02:00
|
|
|
SET(Boost_USE_MULTITHREADED OFF)
|
2011-07-27 01:13:27 +02:00
|
|
|
FIND_PACKAGE(Boost COMPONENTS system REQUIRED)
|
2010-11-18 23:13:35 +01:00
|
|
|
FIND_PACKAGE(OpenGL REQUIRED)
|
2011-05-15 23:12:39 +02:00
|
|
|
FIND_PACKAGE(Lua REQUIRED)
|
2010-11-21 22:48:58 +01:00
|
|
|
FIND_PACKAGE(PhysFS REQUIRED)
|
2011-04-10 03:25:13 +02:00
|
|
|
FIND_PACKAGE(GMP REQUIRED)
|
2011-05-15 19:26:05 +02:00
|
|
|
FIND_PACKAGE(ZLIB 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-05-13 01:54:46 +02:00
|
|
|
SET(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -Wno-unused-but-set-variable -Wno-unused-result -std=gnu++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")
|
|
|
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
|
|
|
|
INCLUDE_DIRECTORIES(
|
2010-11-21 22:48:58 +01:00
|
|
|
${Boost_INCLUDE_DIRS}
|
2011-05-14 03:28:59 +02:00
|
|
|
${OPENGL_INCLUDE_DIR}
|
|
|
|
${LUA_INCLUDE_DIR}
|
|
|
|
${PHYSFS_INCLUDE_DIR}
|
2011-04-10 03:25:13 +02:00
|
|
|
${GMP_INCLUDE_DIR}
|
2011-05-15 19:26:05 +02:00
|
|
|
${ZLIB_INCLUDE_DIR}
|
2011-04-10 17:37:15 +02:00
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/framework")
|
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")
|
|
|
|
|
2011-04-22 00:44:30 +02:00
|
|
|
SET(SOURCES
|
2011-03-19 00:49:30 +01:00
|
|
|
# game sources
|
|
|
|
src/main.cpp
|
2011-04-07 11:36:02 +02:00
|
|
|
|
2011-08-02 04:07:19 +02:00
|
|
|
# game files
|
|
|
|
src/tibiadat.cpp
|
|
|
|
|
2011-04-09 01:24:51 +02:00
|
|
|
# game net
|
2011-04-20 08:40:31 +02:00
|
|
|
src/protocollogin.cpp
|
2011-08-01 06:28:41 +02:00
|
|
|
src/protocolgame.cpp
|
|
|
|
src/protocolgameparse.cpp
|
2011-04-09 01:24:51 +02:00
|
|
|
|
2011-04-10 17:37:15 +02:00
|
|
|
# framework core
|
|
|
|
src/framework/core/dispatcher.cpp
|
|
|
|
src/framework/core/configs.cpp
|
|
|
|
src/framework/core/resources.cpp
|
|
|
|
src/framework/core/engine.cpp
|
2011-07-27 01:13:27 +02:00
|
|
|
src/framework/core/packages.cpp
|
2011-07-13 23:12:36 +02:00
|
|
|
|
|
|
|
# framework otml
|
|
|
|
src/framework/otml/otmlemitter.cpp
|
|
|
|
src/framework/otml/otmlparser.cpp
|
|
|
|
src/framework/otml/otmlnode.cpp
|
2011-04-10 17:37:15 +02:00
|
|
|
|
2011-04-19 04:10:08 +02:00
|
|
|
# framework script
|
2011-07-27 01:13:27 +02:00
|
|
|
src/framework/script/luastate.cpp
|
|
|
|
src/framework/script/luavalue.cpp
|
|
|
|
src/framework/script/luaobject.cpp
|
|
|
|
src/framework/script/luainterface.cpp
|
|
|
|
src/framework/script/luafunctions.cpp
|
|
|
|
src/framework/script/luaexception.cpp
|
|
|
|
src/framework/script/luavaluecasts.cpp
|
2011-04-19 04:10:08 +02:00
|
|
|
|
2011-04-10 17:37:15 +02:00
|
|
|
# framework utilities
|
2011-04-10 22:40:44 +02:00
|
|
|
src/framework/util/color.cpp
|
2011-07-13 23:12:36 +02:00
|
|
|
src/framework/util/translator.cpp
|
|
|
|
src/framework/util/convert.cpp
|
2011-04-10 17:37:15 +02:00
|
|
|
src/framework/util/logger.cpp
|
2011-05-13 01:24:57 +02:00
|
|
|
src/framework/util/apngloader.cpp
|
2011-07-17 02:13:53 +02:00
|
|
|
src/framework/util/allocator.cpp
|
2011-04-10 17:37:15 +02:00
|
|
|
|
|
|
|
# framework graphics
|
|
|
|
src/framework/graphics/image.cpp
|
|
|
|
src/framework/graphics/borderedimage.cpp
|
|
|
|
src/framework/graphics/framebuffer.cpp
|
|
|
|
src/framework/graphics/font.cpp
|
|
|
|
src/framework/graphics/fonts.cpp
|
|
|
|
src/framework/graphics/textureloader.cpp
|
|
|
|
src/framework/graphics/texture.cpp
|
2011-05-13 01:24:57 +02:00
|
|
|
src/framework/graphics/animatedtexture.cpp
|
2011-04-10 17:37:15 +02:00
|
|
|
src/framework/graphics/textures.cpp
|
|
|
|
src/framework/graphics/graphics.cpp
|
2011-04-15 04:13:53 +02:00
|
|
|
src/framework/graphics/textarea.cpp
|
2011-04-10 17:37:15 +02:00
|
|
|
|
|
|
|
# framework ui
|
2011-05-09 22:38:01 +02:00
|
|
|
src/framework/ui/uianchorlayout.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-11 22:06:03 +02:00
|
|
|
src/framework/ui/uilabelskin.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-10 22:40:44 +02:00
|
|
|
src/framework/ui/uiloader.cpp
|
2011-04-08 07:10:00 +02:00
|
|
|
src/framework/ui/uibutton.cpp
|
|
|
|
src/framework/ui/uilabel.cpp
|
2011-04-10 00:55:58 +02:00
|
|
|
src/framework/ui/uiwindow.cpp
|
|
|
|
src/framework/ui/uiwindowskin.cpp
|
2011-04-10 02:51:35 +02:00
|
|
|
src/framework/ui/uitextedit.cpp
|
|
|
|
src/framework/ui/uitexteditskin.cpp
|
2011-04-15 04:13:53 +02:00
|
|
|
src/framework/ui/uicheckboxskin.cpp
|
|
|
|
src/framework/ui/uicheckbox.cpp
|
2011-04-08 07:10:00 +02:00
|
|
|
|
2011-04-10 17:37:15 +02:00
|
|
|
# framework net
|
2011-04-20 08:40:31 +02:00
|
|
|
src/framework/net/connection.cpp
|
|
|
|
src/framework/net/protocol.cpp
|
2011-05-21 21:02:37 +02:00
|
|
|
src/framework/net/inputmessage.cpp
|
|
|
|
src/framework/net/outputmessage.cpp
|
2011-07-13 23:12:36 +02:00
|
|
|
src/framework/net/rsa.cpp
|
2011-04-10 17:37:15 +02:00
|
|
|
)
|
2010-11-18 23:13:35 +01:00
|
|
|
|
|
|
|
IF(WIN32)
|
2011-04-10 17:37:15 +02:00
|
|
|
SET(SOURCES ${SOURCES} src/framework/platform/win32platform.cpp)
|
2011-04-07 11:36:02 +02:00
|
|
|
SET(ADDITIONAL_LIBRARIES ws2_32)
|
2011-05-17 06:48:52 +02:00
|
|
|
IF(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -mwindows")
|
|
|
|
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
|
|
|
|
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
|
|
|
|
ADD_DEFINITIONS(-DWIN32_NO_CONSOLE)
|
2010-11-18 23:13:35 +01:00
|
|
|
ELSE(WIN32)
|
2011-04-10 17:37:15 +02:00
|
|
|
SET(SOURCES ${SOURCES} src/framework/platform/x11platform.cpp)
|
2011-07-27 01:13:27 +02:00
|
|
|
#ADD_DEFINITIONS(-D_DEBUG_MEMORY)
|
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}
|
2011-05-14 03:28:59 +02:00
|
|
|
${OPENGL_LIBRARIES}
|
2011-04-19 04:10:08 +02:00
|
|
|
${LUA_LIBRARIES}
|
2010-11-21 22:48:58 +01:00
|
|
|
${PHYSFS_LIBRARY}
|
2011-05-15 21:19:41 +02:00
|
|
|
${GMP_LIBRARY}
|
2011-05-15 19:26:05 +02:00
|
|
|
${ZLIB_LIBRARY}
|
2011-04-07 11:36:02 +02:00
|
|
|
${ADDITIONAL_LIBRARIES})
|
2011-05-16 22:59:34 +02:00
|
|
|
|
|
|
|
# installation
|
|
|
|
SET(DATA_INSTALL_DIR share/otclient)
|
|
|
|
INSTALL(TARGETS otclient RUNTIME DESTINATION bin)
|
2011-05-16 23:11:21 +02:00
|
|
|
INSTALL(DIRECTORY data DESTINATION ${DATA_INSTALL_DIR})
|