-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
75 lines (64 loc) · 2.46 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#
# Copyright (C) 2005-2018 MaNGOS project <http://getmangos.com/>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
set(LIBRARY_NAME achievements)
#Base files
file(GLOB achievements_source ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp ${CMAKE_CURRENT_SOURCE_DIR}/src/*.h)
source_group("achievements" FILES ${achievements_source})
#Define base source library
set(LIBRARY_SRCS
${achievements_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_ACHIEVEMENTS)
# 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
)
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()
set_target_properties(${LIBRARY_NAME} PROPERTIES PROJECT_LABEL "Achievements")
set_target_properties(${LIBRARY_NAME} PROPERTIES FOLDER "Modules")
# Install config files
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/src/achievements.conf.dist.in ${CMAKE_CURRENT_BINARY_DIR}/achievements.conf.dist)
if (NOT CONF_INSTALL_DIR)
set(CONF_INSTALL_DIR ${CONF_DIR})
endif()
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/achievements.conf.dist DESTINATION ${CONF_INSTALL_DIR})