Rework application class and framework

Make otclient's framework flexible enough to run console apps like
servers, so this mean is possible to build otclient versions without
graphical interface and use it's framework to code servers
This commit is contained in:
Eduardo Bart
2012-07-13 22:10:24 -03:00
parent 099716fe03
commit e3298d561c
131 changed files with 1228 additions and 1016 deletions

View File

@@ -1,46 +1,49 @@
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
PROJECT(otclient)
cmake_minimum_required(VERSION 2.6)
project(otclient)
ADD_DEFINITIONS(-DFW_WINDOW)
INCLUDE(src/framework/CMakeLists.txt)
INCLUDE(src/otclient/CMakeLists.txt)
set(FRAMEWORK_SOUND ON)
set(FRAMEWORK_GRAPHICS ON)
set(FRAMEWORK_XML ON)
set(FRAMEWORK_NET ON)
include(src/framework/CMakeLists.txt)
include(src/otclient/CMakeLists.txt)
# functions map for reading backtraces
SET(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,-Map=otclient.map")
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,-Map=otclient.map")
OPTION(USE_PCH "Use precompiled header (speed up compile)" OFF)
option(USE_PCH "Use precompiled header (speed up compile)" OFF)
SET(executable_SOURCES
set(executable_SOURCES
src/main.cpp
)
# add executable icon for win32 platforms
IF(WIN32)
ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/otcicon.o
if(WIN32)
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/otcicon.o
COMMAND ${CMAKE_RC_COMPILER}
-I${CMAKE_CURRENT_SOURCE_DIR}/src
-i${CMAKE_CURRENT_SOURCE_DIR}/src/otcicon.rc
-o ${CMAKE_CURRENT_BINARY_DIR}/otcicon.o)
SET(executable_SOURCES ${executable_SOURCES} otcicon.o)
ENDIF(WIN32)
endif(WIN32)
# add otclient executable
ADD_EXECUTABLE(otclient ${framework_SOURCES} ${otclient_SOURCES} ${executable_SOURCES})
add_executable(otclient ${framework_SOURCES} ${otclient_SOURCES} ${executable_SOURCES})
# target link libraries
TARGET_LINK_LIBRARIES(otclient ${framework_LIBRARIES})
target_link_libraries(otclient ${framework_LIBRARIES})
IF(USE_PCH)
if(USE_PCH)
include(cotire)
cotire(otclient)
MESSAGE(STATUS "Use precompiled header: ON")
ELSE()
MESSAGE(STATUS "Use precompiled header: OFF")
ENDIF()
message(STATUS "Use precompiled header: ON")
else()
message(STATUS "Use precompiled header: OFF")
endif()
# installation
SET(DATA_INSTALL_DIR share/otclient)
INSTALL(TARGETS otclient RUNTIME DESTINATION bin)
INSTALL(DIRECTORY modules DESTINATION ${DATA_INSTALL_DIR}
set(DATA_INSTALL_DIR share/otclient)
install(TARGETS otclient RUNTIME DESTINATION bin)
install(FILES README.md BUGS LICENSE AUTHORS init.lua DESTINATION ${DATA_INSTALL_DIR})
install(DIRECTORY modules DESTINATION ${DATA_INSTALL_DIR}
PATTERN ".git" EXCLUDE)