tibia-client/CMakeLists.txt

138 lines
3.8 KiB
CMake
Raw Normal View History

2010-11-08 23:04:33 +01:00
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(otclient)
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake;${CMAKE_MODULE_PATH}")
# 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)
FIND_PACKAGE(OpenGL REQUIRED)
FIND_PACKAGE(Lua51 REQUIRED)
FIND_PACKAGE(YamlCpp REQUIRED)
FIND_PACKAGE(PhysFS REQUIRED)
FIND_PACKAGE(PNG REQUIRED)
2011-04-10 03:25:13 +02:00
FIND_PACKAGE(GMP REQUIRED)
# 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-14 03:30:41 +02:00
SET(CMAKE_CXX_FLAGS "-Wall -Wextra -Werror -Wno-unused-parameter -std=gnu++0x")
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")
SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,--as-needed")
ENDIF(CMAKE_COMPILER_IS_GNUCXX)
INCLUDE_DIRECTORIES(
${Boost_INCLUDE_DIRS}
${LUA_INCLUDE_DIRS}
${YAMLCPP_INCLUDE_DIRS}
${PHYSFS_INCLUDE_DIRS}
2011-04-10 03:25:13 +02:00
${GMP_INCLUDE_DIR}
2011-04-10 17:37:15 +02:00
${PNG_INCLUDE_DIRS}
"${CMAKE_CURRENT_SOURCE_DIR}/src/framework")
LINK_DIRECTORIES(
${Boost_LIBRARY_DIRS}
${LUA_LIBRARY_DIRS}
${PHYSFS_LIBRARY_DIRS}
${YAMLCPP_LIBRARY_DIRS}
${PNG_LIBRARY_DIRS})
# setup definitions
ADD_DEFINITIONS(-D_REENTRANT)
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
ADD_DEFINITIONS(-D_DEBUG)
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
2011-04-15 04:13:53 +02:00
SET(SOURCES
# 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-04-09 01:24:51 +02:00
# game net
src/net/protocoltibia87.cpp
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
# framework utilities
2011-04-10 22:40:44 +02:00
src/framework/util/color.cpp
2011-04-10 17:37:15 +02:00
src/framework/util/util.cpp
src/framework/util/logger.cpp
src/framework/util/rsa.cpp
# 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
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-04-10 22:40:44 +02:00
src/framework/ui/uilayout.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
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/uipanel.cpp
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/uilinedecorationskin.cpp
src/framework/ui/uicheckboxskin.cpp
src/framework/ui/uilinedecoration.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-07 10:42:57 +02:00
src/framework/net/connection.cpp
2011-04-09 01:24:51 +02:00
src/framework/net/connections.cpp
src/framework/net/protocol.cpp
2011-04-10 03:25:13 +02:00
src/framework/net/networkmessage.cpp
2011-04-10 17:37:15 +02: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)
ADD_DEFINITIONS(-D_WIN32_WINNT=0x0501)
ELSE(WIN32)
2011-04-10 17:37:15 +02:00
SET(SOURCES ${SOURCES} src/framework/platform/x11platform.cpp)
2011-04-07 11:36:02 +02:00
SET(ADDITIONAL_LIBRARIES pthread GLU)
ENDIF(WIN32)
# target executable
ADD_EXECUTABLE(otclient ${SOURCES})
# target link libraries
TARGET_LINK_LIBRARIES(otclient
${Boost_LIBRARIES}
${OPENGL_LIBRARY}
${LUA51_LIBRARY}
${YAMLCPP_LIBRARY}
${PHYSFS_LIBRARY}
2011-04-07 11:36:02 +02:00
${PNG_LIBRARY}
2011-04-10 03:25:13 +02:00
${GMP_LIBRARIES}
2011-04-07 11:36:02 +02:00
${ADDITIONAL_LIBRARIES})