2012-07-14 03:10:24 +02:00
|
|
|
cmake_minimum_required(VERSION 2.6)
|
|
|
|
project(otclient)
|
2010-11-18 23:13:35 +01:00
|
|
|
|
2012-10-05 01:33:10 +02:00
|
|
|
set(VERSION "0.5.4")
|
2012-08-30 00:00:08 +02:00
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
set(FRAMEWORK_SOUND ON)
|
|
|
|
set(FRAMEWORK_GRAPHICS ON)
|
|
|
|
set(FRAMEWORK_XML ON)
|
|
|
|
set(FRAMEWORK_NET ON)
|
2012-08-18 19:08:05 +02:00
|
|
|
#set(FRAMEWORK_GIT ON)
|
2012-07-14 03:10:24 +02:00
|
|
|
include(src/framework/CMakeLists.txt)
|
|
|
|
include(src/otclient/CMakeLists.txt)
|
2010-11-21 22:48:58 +01:00
|
|
|
|
2012-04-02 14:49:43 +02:00
|
|
|
# functions map for reading backtraces
|
2012-07-14 03:10:24 +02:00
|
|
|
set(CMAKE_CXX_LINK_FLAGS "${CMAKE_CXX_LINK_FLAGS} -Wl,-Map=otclient.map")
|
2012-04-02 14:49:43 +02:00
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
option(USE_PCH "Use precompiled header (speed up compile)" OFF)
|
2011-08-14 04:09:11 +02:00
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
set(executable_SOURCES
|
2012-06-20 02:15:56 +02:00
|
|
|
src/main.cpp
|
|
|
|
)
|
2011-11-03 21:54:53 +01:00
|
|
|
|
2011-12-05 07:44:03 +01:00
|
|
|
# add executable icon for win32 platforms
|
2012-07-14 03:10:24 +02:00
|
|
|
if(WIN32)
|
|
|
|
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/otcicon.o
|
2011-11-17 03:53:17 +01:00
|
|
|
COMMAND ${CMAKE_RC_COMPILER}
|
2011-12-05 07:44:03 +01:00
|
|
|
-I${CMAKE_CURRENT_SOURCE_DIR}/src
|
|
|
|
-i${CMAKE_CURRENT_SOURCE_DIR}/src/otcicon.rc
|
|
|
|
-o ${CMAKE_CURRENT_BINARY_DIR}/otcicon.o)
|
2012-08-20 23:53:06 +02:00
|
|
|
set(executable_SOURCES ${executable_SOURCES} otcicon.o)
|
2012-08-03 12:13:46 +02:00
|
|
|
endif()
|
2010-11-18 23:13:35 +01:00
|
|
|
|
2012-08-30 00:00:08 +02:00
|
|
|
add_definitions(-D"VERSION=\\"${VERSION}\\"")
|
|
|
|
|
2011-12-05 07:44:03 +01:00
|
|
|
# add otclient executable
|
2012-07-14 03:10:24 +02:00
|
|
|
add_executable(otclient ${framework_SOURCES} ${otclient_SOURCES} ${executable_SOURCES})
|
2010-11-18 23:13:35 +01:00
|
|
|
|
|
|
|
# target link libraries
|
2012-07-14 03:10:24 +02:00
|
|
|
target_link_libraries(otclient ${framework_LIBRARIES})
|
2011-08-14 04:09:11 +02:00
|
|
|
|
2012-07-14 03:10:24 +02:00
|
|
|
if(USE_PCH)
|
2012-06-17 01:19:43 +02:00
|
|
|
include(cotire)
|
|
|
|
cotire(otclient)
|
2012-07-14 03:10:24 +02:00
|
|
|
message(STATUS "Use precompiled header: ON")
|
|
|
|
else()
|
|
|
|
message(STATUS "Use precompiled header: OFF")
|
|
|
|
endif()
|
2011-05-16 22:59:34 +02:00
|
|
|
|
|
|
|
# installation
|
2012-07-14 03:10:24 +02:00
|
|
|
set(DATA_INSTALL_DIR share/otclient)
|
|
|
|
install(TARGETS otclient RUNTIME DESTINATION bin)
|
2012-08-18 19:08:05 +02:00
|
|
|
install(FILES README.md BUGS LICENSE AUTHORS init.lua otclientrc.lua DESTINATION ${DATA_INSTALL_DIR})
|
2012-08-08 03:58:15 +02:00
|
|
|
install(DIRECTORY modules DESTINATION ${DATA_INSTALL_DIR} PATTERN ".git" EXCLUDE)
|
2012-08-14 21:41:48 +02:00
|
|
|
|
|
|
|
# add "make run"
|
|
|
|
add_custom_target(run COMMAND otclient DEPENDS otclient WORKING_DIRECTORY ${CMAKE_PROJECT_DIR})
|