mirror of
https://github.com/edubart/otclient.git
synced 2025-10-18 21:43:26 +02:00
* basic core design (Platform, Engine, Graphics classes)
* logger * x11 platform implementation
This commit is contained in:
@@ -1,4 +1,61 @@
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
|
||||
PROJECT(otclient)
|
||||
ADD_EXECUTABLE(otclient srcs/main.cpp)
|
||||
|
||||
# find needed packages
|
||||
SET(Boost_USE_STATIC_LIBS ON)
|
||||
FIND_PACKAGE(Boost COMPONENTS thread filesystem REQUIRED)
|
||||
FIND_PACKAGE(OpenGL REQUIRED)
|
||||
FIND_PACKAGE(Lua51 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)
|
||||
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wl,--as-needed")
|
||||
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(
|
||||
${LUA_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS})
|
||||
|
||||
LINK_DIRECTORIES(
|
||||
${Boost_LIBRARY_DIRS}
|
||||
${LUA_LIBRARY_DIRS})
|
||||
|
||||
# setup definitions
|
||||
ADD_DEFINITIONS(-D_REENTRANT)
|
||||
|
||||
IF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
ADD_DEFINITIONS(-D_DEBUG)
|
||||
ENDIF(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
|
||||
# find sources
|
||||
SET(SOURCES
|
||||
src/main.cpp
|
||||
src/engine.cpp
|
||||
src/graphics.cpp
|
||||
src/logger.cpp
|
||||
src/util.cpp)
|
||||
|
||||
IF(WIN32)
|
||||
SET(SOURCES ${SOURCES} src/win32platform.cpp)
|
||||
ELSE(WIN32)
|
||||
SET(SOURCES ${SOURCES} src/x11platform.cpp)
|
||||
ENDIF(WIN32)
|
||||
|
||||
# target executable
|
||||
ADD_EXECUTABLE(otclient ${SOURCES})
|
||||
|
||||
# target link libraries
|
||||
TARGET_LINK_LIBRARIES(otclient
|
||||
${Boost_LIBRARIES}
|
||||
${OPENGL_LIBRARY}
|
||||
${LUA51_LIBRARY})
|
||||
|
||||
|
Reference in New Issue
Block a user