-
Notifications
You must be signed in to change notification settings - Fork 55
/
Copy pathCMakeLists.txt
193 lines (182 loc) · 6.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
PROJECT (stonesense)
# prevent CMake warnings about INTERFACE_LINK_LIBRARIES vs LINK_INTERFACE_LIBRARIES
IF(CMAKE_VERSION VERSION_GREATER "2.8.12")
CMAKE_POLICY(SET CMP0022 OLD)
ENDIF()
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMake/Modules)
include_directories (${CMAKE_SOURCE_DIR})
SET(PROJECT_SRCS
TrackingModes.cpp
Overlay.cpp
Tile.cpp
TileCondition.cpp
TileTree.cpp
BuildingConfiguration.cpp
ColorConfiguration.cpp
ConditionalSprite.cpp
Config.cpp
Constructions.cpp
ContentBuildingReader.cpp
ContentLoader.cpp
CreatureConfiguration.cpp
Creatures.cpp
DumpInfo.cpp
FluidConfiguration.cpp
GUI.cpp
GameBuildings.cpp
GroundMaterialConfiguration.cpp
ItemConfiguration.cpp
MapLoading.cpp
SegmentProcessing.cpp
OcclusionTest.cpp
SpriteColors.cpp
SpriteMaps.cpp
SpriteObjects.cpp
TreeGrowthConfiguration.cpp
UserInput.cpp
WorldSegment.cpp
VegetationConfiguration.cpp
Keybinds.cpp
EnumToString.cpp
MaterialMatcher.cpp
TiletypeMatcher.cpp
ConnectionState.cpp
main.cpp
)
IF(UNIX)
IF(APPLE)
# Mac OS X
OPTION(STONESENSE_INTERNAL_DYLIB "Link with prebuilt internal allegro libs and headers." ON)
IF(STONESENSE_INTERNAL_DYLIB)
FILE(DOWNLOAD http://topazgryphon.org/~tcollett/df/allegro-5.0.11-osx.tar.bz2
${stonesense_SOURCE_DIR}/allegro-5.0.11-osx.tar.bz2
EXPECTED_MD5 c531eb16f2530e1168116fcbce7644df)
execute_process(COMMAND tar xjf ${stonesense_SOURCE_DIR}/allegro-5.0.11-osx.tar.bz2
WORKING_DIRECTORY ${stonesense_SOURCE_DIR})
SET(PROJECT_LIBS
${stonesense_SOURCE_DIR}/allegro-osx/lib/liballegro.5.0.dylib
${stonesense_SOURCE_DIR}/allegro-osx/lib/liballegro_primitives.5.0.dylib
${stonesense_SOURCE_DIR}/allegro-osx/lib/liballegro_font.5.0.dylib
${stonesense_SOURCE_DIR}/allegro-osx/lib/liballegro_color.5.0.dylib
${stonesense_SOURCE_DIR}/allegro-osx/lib/liballegro_image.5.0.dylib
${stonesense_SOURCE_DIR}/allegro-osx/lib/liballegro_ttf.5.0.dylib
${PROJECT_LIBS}
)
include_directories (
${include_directories}
${stonesense_SOURCE_DIR}/allegro-osx/include
${stonesense_SOURCE_DIR}/allegro-osx/lib/Headers
)
install(DIRECTORY allegro-osx/lib/
DESTINATION "hack/libs"
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE)
ELSE()
SET(PROJECT_LIBS
allegro
allegro_primitives
allegro_font
allegro_color
allegro_image
allegro_ttf
${PROJECT_LIBS}
)
ENDIF()
ELSE(APPLE)
#linux
OPTION(STONESENSE_INTERNAL_SO "Link with prebuilt internal allegro libs and headers." ON)
IF(STONESENSE_INTERNAL_SO)
FILE(DOWNLOAD http://dethware.org/dfhack/download/allegro509b.tar.bz2
${stonesense_SOURCE_DIR}/allegro509b.tar.bz2
EXPECTED_MD5 74ead5d95a83a03a301cdc76fa0a3df8)
execute_process(COMMAND tar xf ${stonesense_SOURCE_DIR}/allegro509b.tar.bz2
WORKING_DIRECTORY ${stonesense_SOURCE_DIR})
SET(PROJECT_LIBS
${stonesense_SOURCE_DIR}/allegro/lib/liballegro.so.5.0
${stonesense_SOURCE_DIR}/allegro/lib/liballegro_primitives.so.5.0
${stonesense_SOURCE_DIR}/allegro/lib/liballegro_font.so.5.0
${stonesense_SOURCE_DIR}/allegro/lib/liballegro_image.so.5.0
${stonesense_SOURCE_DIR}/allegro/lib/liballegro_ttf.so.5.0
${stonesense_SOURCE_DIR}/allegro/lib/liballegro_color.so.5.0
${PROJECT_LIBS}
)
include_directories (
${include_directories}
${stonesense_SOURCE_DIR}/allegro/include
)
install(DIRECTORY allegro/lib/
DESTINATION "hack/libs"
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE)
ELSE()
SET(PROJECT_LIBS
allegro
allegro_primitives
allegro_font
allegro_image
allegro_ttf
allegro_color
${PROJECT_LIBS}
)
ENDIF()
ENDIF()
# windows
ELSE(UNIX)
FILE(DOWNLOAD http://dethware.org/dfhack/download/allegrow509b.tar.gz
${stonesense_SOURCE_DIR}/allegrow509b.tar.gz
EXPECTED_MD5 55b7e37ece699f02192346883ba38677)
execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf ${stonesense_SOURCE_DIR}/allegrow509b.tar.gz
WORKING_DIRECTORY ${stonesense_SOURCE_DIR})
ADD_DEFINITIONS("-DALLEGRO_STATICLINK")
SET(PROJECT_LIBS
kernel32.lib
user32.lib
gdi32.lib
winspool.lib
shell32.lib
ole32.lib
oleaut32.lib
uuid.lib
comdlg32.lib
advapi32.lib
allegro-static.lib
allegro_primitives-static.lib
allegro_font-static.lib
allegro_image-static.lib
allegro_ttf-static.lib
allegro_color-static.lib
freetype-static.lib
winmm.lib
psapi.lib
opengl32.lib
glu32.lib
gdiplus.lib
shlwapi.lib
$(NOINHERIT)
)
include_directories (
${include_directories}
${stonesense_SOURCE_DIR}/allegrow/include
)
LINK_DIRECTORIES(
${LINK_DIRECTORIES}
${stonesense_SOURCE_DIR}/allegrow/lib
)
ENDIF(UNIX)
# Tell CMake the source won't be available until build time.
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/../proto/RemoteFortressReader.pb.cc PROPERTIES GENERATED 1)
SET(PROJECT_SRCS ${PROJECT_SRCS} ${CMAKE_CURRENT_SOURCE_DIR}/../proto/RemoteFortressReader.pb.cc)
DFHACK_PLUGIN(stonesense ${PROJECT_SRCS} LINK_LIBRARIES ${DFHACK_TINYXML} ${PROJECT_LIBS})
# Make sure the source is generated before the executable builds.
ADD_DEPENDENCIES(stonesense generate_proto)
TARGET_LINK_LIBRARIES(stonesense protobuf-lite ${PROJECT_LIBS})
IF(APPLE)
add_custom_command(TARGET stonesense POST_BUILD COMMAND ${stonesense_SOURCE_DIR}/fix-libs-stonesense.sh WORKING_DIRECTORY . COMMENT "Fixing Stonesense library dependencies...")
ENDIF(APPLE)
#install resources into DF/stonesense
install(DIRECTORY resources/
DESTINATION "stonesense"
PATTERN "CVS" EXCLUDE
PATTERN ".svn" EXCLUDE)
# install readme
install(FILES README.md DESTINATION stonesense)