-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
55 lines (45 loc) · 1.7 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
49
50
51
52
53
54
55
set(LIBRARY_NAME paladinpower)
#Base files
file(GLOB paladinpower_source ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
source_group("paladinpower" FILES ${paladinpower_source})
#Define base source library
set(LIBRARY_SRCS ${paladinpower_source})
# Define ENABLE_PLAYERBOTS if need
if (BUILD_PLAYERBOTS)
include_directories(${CMAKE_SOURCE_DIR}/src/modules/PlayerBots)
include_directories(${CMAKE_SOURCE_DIR}/dep/g3dlite)
add_definitions(-DENABLE_PLAYERBOTS)
endif()
include_directories(${CMAKE_SOURCE_DIR}/src/modules/modules/src)
add_definitions(-DENABLE_MODULES)
add_definitions(-DENABLE_PALADINPOWER)
# Define Expansion
if ( ${CMAKE_PROJECT_NAME} MATCHES "Classic")
add_definitions(-DEXPANSION=0)
endif()
if ( ${CMAKE_PROJECT_NAME} MATCHES "TBC")
add_definitions(-DEXPANSION=1)
endif()
if ( ${CMAKE_PROJECT_NAME} MATCHES "WoTLK")
add_definitions(-DEXPANSION=2)
endif()
add_library(${LIBRARY_NAME} STATIC ${LIBRARY_SRCS})
target_link_libraries(${LIBRARY_NAME}
modules
shared
RecastNavigation::Detour
)
set_target_properties(${LIBRARY_NAME} PROPERTIES PROJECT_LABEL "Paladinpower")
set_target_properties(${LIBRARY_NAME} PROPERTIES FOLDER "Modules")
if(UNIX)
# Both systems don't have libdl and don't need them
if (NOT (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD" OR CMAKE_SYSTEM_NAME STREQUAL "NetBSD"))
target_link_libraries(${LIBRARY_NAME} dl)
endif()
endif()
# Install config files
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/paladinpower.conf.dist.in ${CMAKE_CURRENT_BINARY_DIR}/paladinpower.conf.dist)
if (NOT CONF_INSTALL_DIR)
set(CONF_INSTALL_DIR ${CONF_DIR})
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/paladinpower.conf.dist DESTINATION ${CONF_INSTALL_DIR})