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-12-05 07:44:03 +01:00
|
|
|
INCLUDE(src/framework/CMakeLists.txt)
|
|
|
|
INCLUDE(src/otclient/CMakeLists.txt)
|
2010-11-21 22:48:58 +01:00
|
|
|
|
2011-12-05 07:44:03 +01:00
|
|
|
OPTION(USE_PCH "Use precompiled header (speed up compile)" ON)
|
2011-08-14 04:09:11 +02:00
|
|
|
|
2011-12-05 19:27:07 +01:00
|
|
|
SET(executable_SOURCES 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
|
2010-11-18 23:13:35 +01:00
|
|
|
IF(WIN32)
|
2011-12-05 07:44:03 +01:00
|
|
|
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)
|
2011-12-05 19:27:07 +01:00
|
|
|
SET(executable_SOURCES ${executable_SOURCES} otcicon.o)
|
2010-11-18 23:13:35 +01:00
|
|
|
ENDIF(WIN32)
|
|
|
|
|
2011-12-05 07:44:03 +01:00
|
|
|
# add otclient executable
|
2011-12-05 19:27:07 +01:00
|
|
|
ADD_EXECUTABLE(otclient ${framework_SOURCES} ${otclient_SOURCES} ${executable_SOURCES})
|
2010-11-18 23:13:35 +01:00
|
|
|
|
|
|
|
# target link libraries
|
2011-12-05 19:27:07 +01:00
|
|
|
TARGET_LINK_LIBRARIES(otclient ${framework_LIBRARIES})
|
2011-08-14 04:09:11 +02:00
|
|
|
|
|
|
|
IF(USE_PCH)
|
2011-12-05 07:44:03 +01:00
|
|
|
FIND_PACKAGE(PCHSupport REQUIRED)
|
2011-12-04 23:26:53 +01:00
|
|
|
ADD_PRECOMPILED_HEADER(otclient ${CMAKE_CURRENT_SOURCE_DIR}/src/framework/pch.h)
|
2011-12-05 07:44:03 +01:00
|
|
|
MESSAGE(STATUS "Use precompiled header: ON")
|
|
|
|
ELSEIF(USE_PCH)
|
|
|
|
MESSAGE(STATUS "Use precompiled header: OFF")
|
2011-08-14 04:09:11 +02:00
|
|
|
ENDIF(USE_PCH)
|
2011-05-16 22:59:34 +02:00
|
|
|
|
|
|
|
# installation
|
|
|
|
SET(DATA_INSTALL_DIR share/otclient)
|
|
|
|
INSTALL(TARGETS otclient RUNTIME DESTINATION bin)
|
2011-10-30 21:11:43 +01:00
|
|
|
INSTALL(DIRECTORY modules DESTINATION ${DATA_INSTALL_DIR}
|
|
|
|
PATTERN ".git" EXCLUDE)
|