File: CMakeLists.txt

package info (click to toggle)
vcmi 0.99%2Bdfsg%2Bgit20190113.f06c8a87-2
  • links: PTS, VCS
  • area: contrib
  • in suites: bullseye
  • size: 11,136 kB
  • sloc: cpp: 142,615; sh: 315; objc: 248; makefile: 32; ansic: 28; python: 13
file content (397 lines) | stat: -rw-r--r-- 9,850 bytes parent folder | download | duplicates (2)
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
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
set(lib_SRCS
		StdInc.cpp
		${CMAKE_BINARY_DIR}/Version.cpp

		battle/AccessibilityInfo.cpp
		battle/BattleAction.cpp
		battle/BattleAttackInfo.cpp
		battle/BattleHex.cpp
		battle/BattleInfo.cpp
		battle/BattleProxy.cpp
		battle/CBattleInfoCallback.cpp
		battle/CBattleInfoEssentials.cpp
		battle/CCallbackBase.cpp
		battle/CObstacleInstance.cpp
		battle/CPlayerBattleCallback.cpp
		battle/CUnitState.cpp
		battle/Destination.cpp
		battle/IBattleState.cpp
		battle/ReachabilityInfo.cpp
		battle/SideInBattle.cpp
		battle/SiegeInfo.cpp
		battle/Unit.cpp

		filesystem/AdapterLoaders.cpp
		filesystem/CArchiveLoader.cpp
		filesystem/CBinaryReader.cpp
		filesystem/CCompressedStream.cpp
		filesystem/CFileInputStream.cpp
		filesystem/CFilesystemLoader.cpp
		filesystem/CMemoryBuffer.cpp
		filesystem/CMemoryStream.cpp
		filesystem/CZipLoader.cpp
		filesystem/CZipSaver.cpp
		filesystem/FileInfo.cpp
		filesystem/FileStream.cpp
		filesystem/Filesystem.cpp
		filesystem/MinizipExtensions.cpp
		filesystem/ResourceID.cpp

		logging/CBasicLogConfigurator.cpp
		logging/CLogger.cpp

		mapObjects/CArmedInstance.cpp
		mapObjects/CBank.cpp
		mapObjects/CGHeroInstance.cpp
		mapObjects/CGMarket.cpp
		mapObjects/CGPandoraBox.cpp
		mapObjects/CGTownInstance.cpp
		mapObjects/CObjectClassesHandler.cpp
		mapObjects/CObjectHandler.cpp
		mapObjects/CommonConstructors.cpp
		mapObjects/CQuest.cpp
		mapObjects/CRewardableConstructor.cpp
		mapObjects/CRewardableObject.cpp
		mapObjects/JsonRandom.cpp
		mapObjects/MiscObjects.cpp
		mapObjects/ObjectTemplate.cpp

		mapping/CCampaignHandler.cpp
		mapping/CDrawRoadsOperation.cpp
		mapping/CMap.cpp
		mapping/CMapEditManager.cpp
		mapping/CMapInfo.cpp
		mapping/CMapService.cpp
		mapping/MapFormatH3M.cpp
		mapping/MapFormatJson.cpp

		registerTypes/RegisterTypes.cpp
		registerTypes/TypesClientPacks1.cpp
		registerTypes/TypesClientPacks2.cpp
		registerTypes/TypesMapObjects1.cpp
		registerTypes/TypesMapObjects2.cpp
		registerTypes/TypesMapObjects3.cpp
		registerTypes/TypesLobbyPacks.cpp
		registerTypes/TypesServerPacks.cpp

		rmg/CMapGenerator.cpp
		rmg/CMapGenOptions.cpp
		rmg/CRmgTemplate.cpp
		rmg/CRmgTemplateStorage.cpp
		rmg/CRmgTemplateZone.cpp
		rmg/CZoneGraphGenerator.cpp
		rmg/CZonePlacer.cpp

		serializer/BinaryDeserializer.cpp
		serializer/BinarySerializer.cpp
		serializer/CLoadIntegrityValidator.cpp
		serializer/CMemorySerializer.cpp
		serializer/Connection.cpp
		serializer/CSerializer.cpp
		serializer/CTypeList.cpp
		serializer/JsonDeserializer.cpp
		serializer/JsonSerializeFormat.cpp
		serializer/JsonSerializer.cpp

		spells/AbilityCaster.cpp
		spells/AdventureSpellMechanics.cpp
		spells/BattleSpellMechanics.cpp
		spells/BonusCaster.cpp
		spells/CSpellHandler.cpp
		spells/ISpellMechanics.cpp
		spells/Problem.cpp
		spells/ProxyCaster.cpp
		spells/TargetCondition.cpp
		spells/ViewSpellInt.cpp

		spells/effects/Catapult.cpp
		spells/effects/Clone.cpp
		spells/effects/Damage.cpp
		spells/effects/Dispel.cpp
		spells/effects/Effect.cpp
		spells/effects/Effects.cpp
		spells/effects/Heal.cpp
		spells/effects/LocationEffect.cpp
		spells/effects/Obstacle.cpp
		spells/effects/Registry.cpp
		spells/effects/UnitEffect.cpp
		spells/effects/Summon.cpp
		spells/effects/Teleport.cpp
		spells/effects/Timed.cpp
		spells/effects/RemoveObstacle.cpp
		spells/effects/Sacrifice.cpp

		vstd/StringUtils.cpp

		CAndroidVMHelper.cpp
		CArtHandler.cpp
		CBonusTypeHandler.cpp
		CBuildingHandler.cpp
		CConfigHandler.cpp
		CConsoleHandler.cpp
		CCreatureHandler.cpp
		CCreatureSet.cpp
		CGameInfoCallback.cpp
		CGameInterface.cpp
		CGameState.cpp
		CGeneralTextHandler.cpp
		CHeroHandler.cpp
		CModHandler.cpp
		CPathfinder.cpp
		CRandomGenerator.cpp
		CSkillHandler.cpp
		CStack.cpp
		CThreadHelper.cpp
		CTownHandler.cpp
		GameConstants.cpp
		HeroBonus.cpp
		IGameCallback.cpp
		IHandlerBase.cpp
		JsonDetail.cpp
		JsonNode.cpp
		LogicalExpression.cpp
		NetPacksLib.cpp
		StartInfo.cpp
		ResourceSet.cpp
		VCMIDirs.cpp
		VCMI_Lib.cpp

		${VCMILIB_ADDITIONAL_SOURCES}
)

# Version.cpp is a generated file
set_source_files_properties(${CMAKE_BINARY_DIR}/Version.cpp
	PROPERTIES GENERATED TRUE
)

set(lib_HEADERS
		../include/vstd/CLoggerBase.h
		../include/vstd/ContainerUtils.h
		../include/vstd/RNG.h
		../include/vstd/StringUtils.h
		StdInc.h
		../Global.h

		battle/AccessibilityInfo.h
		battle/BattleAction.h
		battle/BattleAttackInfo.h
		battle/BattleHex.h
		battle/BattleInfo.h
		battle/BattleProxy.h
		battle/CBattleInfoCallback.h
		battle/CBattleInfoEssentials.h
		battle/CCallbackBase.h
		battle/CObstacleInstance.h
		battle/CPlayerBattleCallback.h
		battle/CUnitState.h
		battle/Destination.h
		battle/IBattleState.h
		battle/IUnitInfo.h
		battle/ReachabilityInfo.h
		battle/SideInBattle.h
		battle/SiegeInfo.h
		battle/Unit.h

		filesystem/AdapterLoaders.h
		filesystem/CArchiveLoader.h
		filesystem/CBinaryReader.h
		filesystem/CCompressedStream.h
		filesystem/CFileInputStream.h
		filesystem/CFilesystemLoader.h
		filesystem/CInputOutputStream.h
		filesystem/CInputStream.h
		filesystem/CMemoryBuffer.h
		filesystem/CMemoryStream.h
		filesystem/COutputStream.h
		filesystem/CStream.h
		filesystem/CZipLoader.h
		filesystem/CZipSaver.h
		filesystem/FileInfo.h
		filesystem/FileStream.h
		filesystem/Filesystem.h
		filesystem/ISimpleResourceLoader.h
		filesystem/MinizipExtensions.h
		filesystem/ResourceID.h

		logging/CBasicLogConfigurator.h
		logging/CLogger.h

		mapObjects/CArmedInstance.h
		mapObjects/CBank.h
		mapObjects/CGHeroInstance.h
		mapObjects/CGMarket.h
		mapObjects/CGPandoraBox.h
		mapObjects/CGTownInstance.h
		mapObjects/CObjectClassesHandler.h
		mapObjects/CObjectHandler.h
		mapObjects/CommonConstructors.h
		mapObjects/CQuest.h
		mapObjects/CRewardableConstructor.h
		mapObjects/CRewardableObject.h
		mapObjects/JsonRandom.h
		mapObjects/MapObjects.h
		mapObjects/MiscObjects.h
		mapObjects/ObjectTemplate.h

		mapping/CCampaignHandler.h
		mapping/CDrawRoadsOperation.h
		mapping/CMapDefines.h
		mapping/CMapEditManager.h
		mapping/CMap.h
		mapping/CMapInfo.h
		mapping/CMapService.h
		mapping/MapFormatH3M.h
		mapping/MapFormatJson.h

		registerTypes/RegisterTypes.h

		rmg/CMapGenerator.h
		rmg/CMapGenOptions.h
		rmg/CRmgTemplate.h
		rmg/CRmgTemplateStorage.h
		rmg/CRmgTemplateZone.h
		rmg/CZoneGraphGenerator.h
		rmg/CZonePlacer.h
		rmg/float3.h

		serializer/BinaryDeserializer.h
		serializer/BinarySerializer.h
		serializer/CLoadIntegrityValidator.h
		serializer/CMemorySerializer.h
		serializer/Connection.h
		serializer/CSerializer.h
		serializer/CTypeList.h
		serializer/JsonDeserializer.h
		serializer/JsonSerializeFormat.h
		serializer/JsonSerializer.h
		serializer/Cast.h

		spells/AbilityCaster.h
		spells/AdventureSpellMechanics.h
		spells/BattleSpellMechanics.h
		spells/BonusCaster.h
		spells/CSpellHandler.h
		spells/ISpellMechanics.h
		spells/Magic.h
		spells/Problem.h
		spells/ProxyCaster.h
		spells/TargetCondition.h
		spells/ViewSpellInt.h

		spells/effects/Catapult.h
		spells/effects/Clone.h
		spells/effects/Damage.h
		spells/effects/Dispel.h
		spells/effects/Effect.h
		spells/effects/Effects.h
		spells/effects/EffectsFwd.h
		spells/effects/Heal.h
		spells/effects/LocationEffect.h
		spells/effects/Obstacle.h
		spells/effects/Registry.h
		spells/effects/UnitEffect.h
		spells/effects/Summon.h
		spells/effects/Teleport.h
		spells/effects/Timed.h
		spells/effects/RemoveObstacle.h
		spells/effects/Sacrifice.h
		AI_Base.h
		CAndroidVMHelper.h
		CArtHandler.h
		CBonusTypeHandler.h
		CBuildingHandler.h
		CConfigHandler.h
		CConsoleHandler.h
		CCreatureHandler.h
		CCreatureSet.h
		CGameInfoCallback.h
		CGameInterface.h
		CGameStateFwd.h
		CGameState.h
		CGeneralTextHandler.h
		CHeroHandler.h
		CModHandler.h
		CondSh.h
		ConstTransitivePtr.h
		CPathfinder.h
		CPlayerState.h
		CRandomGenerator.h
		CScriptingModule.h
		CSkillHandler.h
		CSoundBase.h
		CStack.h
		CStopWatch.h
		CThreadHelper.h
		CTownHandler.h
		FunctionList.h
		GameConstants.h
		HeroBonus.h
		IBonusTypeHandler.h
		IGameCallback.h
		IGameEventsReceiver.h
		IHandlerBase.h
		int3.h
		Interprocess.h
		JsonDetail.h
		JsonNode.h
		LogicalExpression.h
		NetPacksBase.h
		NetPacks.h
		NetPacksLobby.h
		PathfinderUtil.h
		ResourceSet.h
		ScopeGuard.h
		StartInfo.h
		StringConstants.h
		UnlockGuard.h
		VCMIDirs.h
		vcmi_endian.h
		VCMI_Lib.h
)

assign_source_group(${lib_SRCS} ${lib_HEADERS})

add_library(vcmi SHARED ${lib_SRCS} ${lib_HEADERS})
set_target_properties(vcmi PROPERTIES COMPILE_DEFINITIONS "VCMI_DLL=1")
target_link_libraries(vcmi ${MINIZIP_LIBRARIES} ${Boost_LIBRARIES} ${SDL2_LIBRARY} ${ZLIB_LIBRARIES} ${SYSTEM_LIBS})

target_include_directories(vcmi
	PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}
	PUBLIC ${CMAKE_HOME_DIRECTORY}
	PUBLIC ${CMAKE_HOME_DIRECTORY}/include
	PUBLIC ${Boost_INCLUDE_DIRS}
	PUBLIC ${ZLIB_INCLUDE_DIR}
	PRIVATE ${SDL2_INCLUDE_DIR}
)

if(WIN32)
	set_target_properties(vcmi
		PROPERTIES
			OUTPUT_NAME "VCMI_lib"
			PROJECT_LABEL "VCMI_lib"
	)
endif()

if(ANDROID)
	return()
endif()

vcmi_set_output_dir(vcmi "")

set_target_properties(vcmi PROPERTIES ${PCH_PROPERTIES})
cotire(vcmi)

# We want to deploy assets into build directory for easier debugging without install
add_custom_command(TARGET vcmi POST_BUILD
	COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/config
	COMMAND ${CMAKE_COMMAND} -E remove_directory ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/Mods
	COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/config ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/config
	COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_SOURCE_DIR}/Mods ${CMAKE_BINARY_DIR}/bin/${CMAKE_CFG_INTDIR}/Mods
)

# Update version before vcmi compiling
if(TARGET update_version)
	add_dependencies(vcmi update_version)
endif()

install(TARGETS vcmi RUNTIME DESTINATION ${LIB_DIR} LIBRARY DESTINATION ${LIB_DIR})