forked from edubart/otclient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
48 lines (39 loc) · 1.5 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
cmake_minimum_required(VERSION 2.6)
project(otclient)
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")
option(USE_PCH "Use precompiled header (speed up compile)" OFF)
set(executable_SOURCES
src/main.cpp
)
# add executable icon for win32 platforms
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()
# add otclient executable
add_executable(otclient ${framework_SOURCES} ${otclient_SOURCES} ${executable_SOURCES})
# target link libraries
target_link_libraries(otclient ${framework_LIBRARIES})
if(USE_PCH)
include(cotire)
cotire(otclient)
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(FILES README.md TODO BUGS LICENSE AUTHORS init.lua otclientrc.lua DESTINATION ${DATA_INSTALL_DIR})
install(DIRECTORY modules DESTINATION ${DATA_INSTALL_DIR} PATTERN ".git" EXCLUDE)