CMakeLists.txt 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. set(vcmiclientcommon_SRCS
  2. StdInc.cpp
  3. adventureMap/AdventureMapInterface.cpp
  4. adventureMap/AdventureMapShortcuts.cpp
  5. adventureMap/AdventureMapWidget.cpp
  6. adventureMap/AdventureOptions.cpp
  7. adventureMap/CInGameConsole.cpp
  8. adventureMap/CInfoBar.cpp
  9. adventureMap/CList.cpp
  10. adventureMap/CMinimap.cpp
  11. adventureMap/CResDataBar.cpp
  12. adventureMap/MapAudioPlayer.cpp
  13. adventureMap/TurnTimerWidget.cpp
  14. battle/BattleActionsController.cpp
  15. battle/BattleAnimationClasses.cpp
  16. battle/BattleConsole.cpp
  17. battle/BattleEffectsController.cpp
  18. battle/BattleFieldController.cpp
  19. battle/BattleHero.cpp
  20. battle/BattleInterface.cpp
  21. battle/BattleObstacleController.cpp
  22. battle/BattleOverlayLogVisualizer.cpp
  23. battle/BattleProjectileController.cpp
  24. battle/BattleRenderer.cpp
  25. battle/BattleResultWindow.cpp
  26. battle/BattleSiegeController.cpp
  27. battle/BattleStacksController.cpp
  28. battle/BattleWindow.cpp
  29. battle/CreatureAnimation.cpp
  30. battle/HeroInfoWindow.cpp
  31. battle/QuickSpellPanel.cpp
  32. battle/StackInfoBasicPanel.cpp
  33. battle/StackQueue.cpp
  34. battle/UnitActionPanel.cpp
  35. eventsSDL/NotificationHandler.cpp
  36. eventsSDL/InputHandler.cpp
  37. eventsSDL/InputSourceKeyboard.cpp
  38. eventsSDL/InputSourceMouse.cpp
  39. eventsSDL/InputSourceText.cpp
  40. eventsSDL/InputSourceTouch.cpp
  41. eventsSDL/InputSourceGameController.cpp
  42. gui/CIntObject.cpp
  43. gui/CursorHandler.cpp
  44. gui/EventDispatcher.cpp
  45. gui/EventsReceiver.cpp
  46. gui/InterfaceObjectConfigurable.cpp
  47. gui/FramerateManager.cpp
  48. gui/ShortcutHandler.cpp
  49. gui/WindowHandler.cpp
  50. lobby/CBonusSelection.cpp
  51. lobby/CCampaignInfoScreen.cpp
  52. lobby/CLobbyScreen.cpp
  53. lobby/CSavingScreen.cpp
  54. lobby/CScenarioInfoScreen.cpp
  55. lobby/CSelectionBase.cpp
  56. lobby/TurnOptionsTab.cpp
  57. lobby/ExtraOptionsTab.cpp
  58. lobby/OptionsTab.cpp
  59. lobby/OptionsTabBase.cpp
  60. lobby/RandomMapTab.cpp
  61. lobby/SelectionTab.cpp
  62. mainmenu/CCampaignScreen.cpp
  63. mainmenu/CMainMenu.cpp
  64. mainmenu/CPrologEpilogVideo.cpp
  65. mainmenu/CreditsScreen.cpp
  66. mainmenu/CHighScoreScreen.cpp
  67. mainmenu/CStatisticScreen.cpp
  68. mapView/MapRenderer.cpp
  69. mapView/MapRendererContext.cpp
  70. mapView/MapRendererContextState.cpp
  71. mapView/MapView.cpp
  72. mapView/MapViewActions.cpp
  73. mapView/MapViewCache.cpp
  74. mapView/MapViewController.cpp
  75. mapView/MapViewModel.cpp
  76. mapView/mapHandler.cpp
  77. mapView/MapOverlayLogVisualizer.cpp
  78. media/CAudioBase.cpp
  79. media/CMusicHandler.cpp
  80. media/CSoundHandler.cpp
  81. media/CVideoHandler.cpp
  82. netlag/NetworkLagCompensator.cpp
  83. netlag/PackRollbackGeneratorVisitor.cpp
  84. render/AssetGenerator.cpp
  85. render/CAnimation.cpp
  86. render/CBitmapHandler.cpp
  87. render/CDefFile.cpp
  88. render/Canvas.cpp
  89. render/CanvasImage.cpp
  90. render/ColorFilter.cpp
  91. render/Colors.cpp
  92. render/Graphics.cpp
  93. render/IFont.cpp
  94. render/ImageLocator.cpp
  95. renderSDL/CBitmapFont.cpp
  96. renderSDL/CTrueTypeFont.cpp
  97. renderSDL/CursorHardware.cpp
  98. renderSDL/CursorSoftware.cpp
  99. renderSDL/FontChain.cpp
  100. renderSDL/ScalableImage.cpp
  101. renderSDL/RenderHandler.cpp
  102. renderSDL/SDLImage.cpp
  103. renderSDL/SDLImageLoader.cpp
  104. renderSDL/SDLImageScaler.cpp
  105. renderSDL/SDLRWwrapper.cpp
  106. renderSDL/ScreenHandler.cpp
  107. renderSDL/SDL_Extensions.cpp
  108. globalLobby/GlobalLobbyAddChannelWindow.cpp
  109. globalLobby/GlobalLobbyClient.cpp
  110. globalLobby/GlobalLobbyInviteWindow.cpp
  111. globalLobby/GlobalLobbyLoginWindow.cpp
  112. globalLobby/GlobalLobbyRoomWindow.cpp
  113. globalLobby/GlobalLobbyServerSetup.cpp
  114. globalLobby/GlobalLobbyWidget.cpp
  115. globalLobby/GlobalLobbyWindow.cpp
  116. widgets/Buttons.cpp
  117. widgets/CComponent.cpp
  118. widgets/CComponentHolder.cpp
  119. widgets/CExchangeController.cpp
  120. widgets/CGarrisonInt.cpp
  121. widgets/CreatureCostBox.cpp
  122. widgets/ComboBox.cpp
  123. widgets/CTextInput.cpp
  124. widgets/GraphicalPrimitiveCanvas.cpp
  125. widgets/Images.cpp
  126. widgets/MiscWidgets.cpp
  127. widgets/ObjectLists.cpp
  128. widgets/TextControls.cpp
  129. widgets/Scrollable.cpp
  130. widgets/Slider.cpp
  131. widgets/CArtifactsOfHeroBase.cpp
  132. widgets/CArtifactsOfHeroMain.cpp
  133. widgets/CArtifactsOfHeroKingdom.cpp
  134. widgets/CArtifactsOfHeroAltar.cpp
  135. widgets/CArtifactsOfHeroMarket.cpp
  136. widgets/CArtifactsOfHeroBackpack.cpp
  137. widgets/RadialMenu.cpp
  138. widgets/VideoWidget.cpp
  139. widgets/markets/CAltarArtifacts.cpp
  140. widgets/markets/CAltarCreatures.cpp
  141. widgets/markets/CArtifactsBuying.cpp
  142. widgets/markets/CArtifactsSelling.cpp
  143. widgets/markets/CFreelancerGuild.cpp
  144. widgets/markets/CMarketResources.cpp
  145. widgets/markets/CTransferResources.cpp
  146. widgets/markets/CMarketBase.cpp
  147. widgets/markets/TradePanels.cpp
  148. windows/CCastleInterface.cpp
  149. windows/CCreatureWindow.cpp
  150. windows/CExchangeWindow.cpp
  151. windows/CHeroOverview.cpp
  152. windows/CHeroWindow.cpp
  153. windows/CKingdomInterface.cpp
  154. windows/CMapOverview.cpp
  155. windows/CMarketWindow.cpp
  156. windows/CMessage.cpp
  157. windows/CPuzzleWindow.cpp
  158. windows/CQuestLog.cpp
  159. windows/CSpellWindow.cpp
  160. windows/CTutorialWindow.cpp
  161. windows/CWindowObject.cpp
  162. windows/CreaturePurchaseCard.cpp
  163. windows/GUIClasses.cpp
  164. windows/InfoWindows.cpp
  165. windows/QuickRecruitmentWindow.cpp
  166. windows/CHeroBackpackWindow.cpp
  167. windows/CWindowWithArtifacts.cpp
  168. windows/settings/GeneralOptionsTab.cpp
  169. windows/settings/OtherOptionsTab.cpp
  170. windows/settings/SettingsMainWindow.cpp
  171. windows/settings/BattleOptionsTab.cpp
  172. windows/settings/AdventureOptionsTab.cpp
  173. windows/settings/KeyBindingsWindow.cpp
  174. xBRZ/xbrz.cpp
  175. ArtifactsUIController.cpp
  176. GameEngine.cpp
  177. GameInstance.cpp
  178. CPlayerInterface.cpp
  179. PlayerLocalState.cpp
  180. CServerHandler.cpp
  181. Client.cpp
  182. ClientCommandManager.cpp
  183. GameChatHandler.cpp
  184. HeroMovementController.cpp
  185. NetPacksClient.cpp
  186. NetPacksLobbyClient.cpp
  187. ServerRunner.cpp
  188. UIHelper.cpp
  189. )
  190. set(vcmiclientcommon_HEADERS
  191. StdInc.h
  192. adventureMap/AdventureMapInterface.h
  193. adventureMap/AdventureMapShortcuts.h
  194. adventureMap/AdventureMapWidget.h
  195. adventureMap/AdventureState.h
  196. adventureMap/AdventureOptions.h
  197. adventureMap/CInGameConsole.h
  198. adventureMap/CInfoBar.h
  199. adventureMap/CList.h
  200. adventureMap/CMinimap.h
  201. adventureMap/CResDataBar.h
  202. adventureMap/MapAudioPlayer.h
  203. adventureMap/TurnTimerWidget.h
  204. battle/BattleActionsController.h
  205. battle/BattleAnimationClasses.h
  206. battle/BattleConsole.h
  207. battle/BattleEffectsController.h
  208. battle/BattleFieldController.h
  209. battle/BattleHero.h
  210. battle/BattleInterface.h
  211. battle/BattleObstacleController.h
  212. battle/BattleOverlayLogVisualizer.h
  213. battle/BattleProjectileController.h
  214. battle/BattleRenderer.h
  215. battle/BattleResultWindow.h
  216. battle/BattleSiegeController.h
  217. battle/BattleStacksController.h
  218. battle/BattleWindow.h
  219. battle/CreatureAnimation.h
  220. battle/HeroInfoWindow.h
  221. battle/QuickSpellPanel.h
  222. battle/StackInfoBasicPanel.h
  223. battle/StackQueue.h
  224. battle/UnitActionPanel.h
  225. eventsSDL/NotificationHandler.h
  226. eventsSDL/InputHandler.h
  227. eventsSDL/InputSourceKeyboard.h
  228. eventsSDL/InputSourceMouse.h
  229. eventsSDL/InputSourceText.h
  230. eventsSDL/InputSourceTouch.h
  231. eventsSDL/InputSourceGameController.h
  232. gui/CIntObject.h
  233. gui/CursorHandler.h
  234. gui/EventDispatcher.h
  235. gui/EventsReceiver.h
  236. gui/InterfaceObjectConfigurable.h
  237. gui/FramerateManager.h
  238. gui/MouseButton.h
  239. gui/Shortcut.h
  240. gui/ShortcutHandler.h
  241. gui/TextAlignment.h
  242. gui/WindowHandler.h
  243. lobby/CBonusSelection.h
  244. lobby/CCampaignInfoScreen.h
  245. lobby/CLobbyScreen.h
  246. lobby/CSavingScreen.h
  247. lobby/CScenarioInfoScreen.h
  248. lobby/CSelectionBase.h
  249. lobby/TurnOptionsTab.h
  250. lobby/ExtraOptionsTab.h
  251. lobby/OptionsTab.h
  252. lobby/OptionsTabBase.h
  253. lobby/RandomMapTab.h
  254. lobby/SelectionTab.h
  255. mainmenu/CCampaignScreen.h
  256. mainmenu/CMainMenu.h
  257. mainmenu/CPrologEpilogVideo.h
  258. mainmenu/CreditsScreen.h
  259. mainmenu/CHighScoreScreen.h
  260. mainmenu/CStatisticScreen.h
  261. mapView/IMapRendererContext.h
  262. mapView/IMapRendererObserver.h
  263. mapView/MapRenderer.h
  264. mapView/MapRendererContext.h
  265. mapView/MapRendererContextState.h
  266. mapView/MapView.h
  267. mapView/MapViewActions.h
  268. mapView/MapViewCache.h
  269. mapView/MapViewController.h
  270. mapView/MapViewModel.h
  271. mapView/mapHandler.h
  272. mapView/MapOverlayLogVisualizer.h
  273. media/CAudioBase.h
  274. media/CEmptyVideoPlayer.h
  275. media/CMusicHandler.h
  276. media/CSoundHandler.h
  277. media/CVideoHandler.h
  278. media/IMusicPlayer.h
  279. media/ISoundPlayer.h
  280. media/IVideoPlayer.h
  281. netlag/NetworkLagCompensator.h
  282. netlag/NetworkLagPredictedPack.h
  283. netlag/NetworkLagPredictionTestVisitor.h
  284. netlag/NetworkLagReplyPrediction.h
  285. netlag/PackRollbackGeneratorVisitor.h
  286. render/AssetGenerator.h
  287. render/CAnimation.h
  288. render/CBitmapHandler.h
  289. render/CDefFile.h
  290. render/Canvas.h
  291. render/CanvasImage.h
  292. render/ColorFilter.h
  293. render/Colors.h
  294. render/EFont.h
  295. render/Graphics.h
  296. render/ICursor.h
  297. render/IFont.h
  298. render/IImage.h
  299. render/IImageLoader.h
  300. render/ImageLocator.h
  301. render/IRenderHandler.h
  302. render/IScreenHandler.h
  303. renderSDL/CBitmapFont.h
  304. renderSDL/CTrueTypeFont.h
  305. renderSDL/CursorHardware.h
  306. renderSDL/CursorSoftware.h
  307. renderSDL/FontChain.h
  308. renderSDL/ScalableImage.h
  309. renderSDL/RenderHandler.h
  310. renderSDL/SDLImage.h
  311. renderSDL/SDLImageLoader.h
  312. renderSDL/SDLImageScaler.h
  313. renderSDL/SDLRWwrapper.h
  314. renderSDL/ScreenHandler.h
  315. renderSDL/SDL_Extensions.h
  316. renderSDL/SDL_PixelAccess.h
  317. globalLobby/GlobalLobbyClient.h
  318. globalLobby/GlobalLobbyDefines.h
  319. globalLobby/GlobalLobbyAddChannelWindow.h
  320. globalLobby/GlobalLobbyInviteWindow.h
  321. globalLobby/GlobalLobbyLoginWindow.h
  322. globalLobby/GlobalLobbyRoomWindow.h
  323. globalLobby/GlobalLobbyServerSetup.h
  324. globalLobby/GlobalLobbyObserver.h
  325. globalLobby/GlobalLobbyWidget.h
  326. globalLobby/GlobalLobbyWindow.h
  327. widgets/Buttons.h
  328. widgets/CComponent.h
  329. widgets/CComponentHolder.h
  330. widgets/CExchangeController.h
  331. widgets/CGarrisonInt.h
  332. widgets/CreatureCostBox.h
  333. widgets/ComboBox.h
  334. widgets/CTextInput.h
  335. widgets/GraphicalPrimitiveCanvas.h
  336. widgets/Images.h
  337. widgets/MiscWidgets.h
  338. widgets/ObjectLists.h
  339. widgets/TextControls.h
  340. widgets/Scrollable.h
  341. widgets/Slider.h
  342. widgets/CArtifactsOfHeroBase.h
  343. widgets/CArtifactsOfHeroMain.h
  344. widgets/CArtifactsOfHeroKingdom.h
  345. widgets/CArtifactsOfHeroAltar.h
  346. widgets/CArtifactsOfHeroMarket.h
  347. widgets/CArtifactsOfHeroBackpack.h
  348. widgets/IVideoHolder.h
  349. widgets/RadialMenu.h
  350. widgets/VideoWidget.h
  351. widgets/markets/CAltarArtifacts.h
  352. widgets/markets/CAltarCreatures.h
  353. widgets/markets/CArtifactsBuying.h
  354. widgets/markets/CArtifactsSelling.h
  355. widgets/markets/CFreelancerGuild.h
  356. widgets/markets/CMarketResources.h
  357. widgets/markets/CTransferResources.h
  358. widgets/markets/CMarketBase.h
  359. widgets/markets/TradePanels.h
  360. windows/CCastleInterface.h
  361. windows/CCreatureWindow.h
  362. windows/CExchangeWindow.h
  363. windows/CHeroOverview.h
  364. windows/CHeroWindow.h
  365. windows/CKingdomInterface.h
  366. windows/CMessage.h
  367. windows/CMapOverview.h
  368. windows/CMarketWindow.h
  369. windows/CPuzzleWindow.h
  370. windows/CQuestLog.h
  371. windows/CSpellWindow.h
  372. windows/CTutorialWindow.h
  373. windows/CWindowObject.h
  374. windows/CreaturePurchaseCard.h
  375. windows/GUIClasses.h
  376. windows/InfoWindows.h
  377. windows/QuickRecruitmentWindow.h
  378. windows/CHeroBackpackWindow.h
  379. windows/CWindowWithArtifacts.h
  380. windows/settings/GeneralOptionsTab.h
  381. windows/settings/OtherOptionsTab.h
  382. windows/settings/SettingsMainWindow.h
  383. windows/settings/BattleOptionsTab.h
  384. windows/settings/AdventureOptionsTab.h
  385. windows/settings/KeyBindingsWindow.h
  386. xBRZ/xbrz.h
  387. xBRZ/xbrz_tools.h
  388. ArtifactsUIController.h
  389. CMT.h
  390. CPlayerInterface.h
  391. GameEngine.h
  392. GameEngineUser.h
  393. GameInstance.h
  394. PlayerLocalState.h
  395. CServerHandler.h
  396. Client.h
  397. ClientCommandManager.h
  398. ClientNetPackVisitors.h
  399. HeroMovementController.h
  400. GameChatHandler.h
  401. LobbyClientNetPackVisitors.h
  402. ServerRunner.h
  403. resource.h
  404. UIHelper.h
  405. )
  406. if(IOS)
  407. set(vcmiclientcommon_SRCS ${vcmiclientcommon_SRCS}
  408. ios/utils.mm
  409. )
  410. set(vcmiclientcommon_HEADERS ${vcmiclientcommon_HEADERS}
  411. ios/utils.h
  412. )
  413. endif()
  414. assign_source_group(${vcmiclientcommon_SRCS} ${vcmiclientcommon_HEADERS})
  415. add_library(vcmiclientcommon STATIC ${vcmiclientcommon_SRCS} ${vcmiclientcommon_HEADERS})
  416. if(NOT ENABLE_STATIC_LIBS)
  417. add_dependencies(vcmiclientcommon
  418. BattleAI
  419. EmptyAI
  420. StupidAI
  421. VCAI
  422. )
  423. if(ENABLE_NULLKILLER_AI)
  424. add_dependencies(vcmiclientcommon Nullkiller)
  425. endif()
  426. endif()
  427. if(IOS)
  428. if(ENABLE_ERM)
  429. add_dependencies(vcmiclientcommon vcmiERM)
  430. endif()
  431. if(ENABLE_LUA)
  432. add_dependencies(vcmiclientcommon vcmiLua)
  433. endif()
  434. endif()
  435. if(WIN32)
  436. set_target_properties(vcmiclientcommon
  437. PROPERTIES
  438. OUTPUT_NAME "VCMI_vcmiclientcommon"
  439. PROJECT_LABEL "VCMI_vcmiclientcommon"
  440. )
  441. set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT vcmiclientcommon)
  442. if(NOT ENABLE_DEBUG_CONSOLE)
  443. target_link_libraries(vcmiclientcommon SDL2::SDL2main)
  444. endif()
  445. target_compile_definitions(vcmiclientcommon PRIVATE WINDOWS_IGNORE_PACKING_MISMATCH)
  446. elseif(IOS)
  447. target_link_libraries(vcmiclientcommon PRIVATE
  448. iOS_utils
  449. # FFmpeg
  450. bz2
  451. iconv
  452. z
  453. "-framework AudioToolbox"
  454. "-framework AVFoundation"
  455. "-framework CoreMedia"
  456. "-framework VideoToolbox"
  457. )
  458. endif()
  459. target_link_libraries(vcmiclientcommon PRIVATE vcmiservercommon)
  460. target_link_libraries(vcmiclientcommon PUBLIC
  461. vcmi SDL2::SDL2 SDL2::Image SDL2::Mixer SDL2::TTF
  462. )
  463. if(ENABLE_VIDEO)
  464. target_compile_definitions(vcmiclientcommon PRIVATE ENABLE_VIDEO)
  465. target_link_libraries(vcmiclientcommon PRIVATE
  466. ${ffmpeg_LIBRARIES}
  467. )
  468. endif()
  469. target_include_directories(vcmiclientcommon PUBLIC
  470. ${CMAKE_CURRENT_SOURCE_DIR}
  471. )
  472. if (ffmpeg_INCLUDE_DIRS)
  473. target_include_directories(vcmiclientcommon PRIVATE
  474. ${ffmpeg_INCLUDE_DIRS}
  475. )
  476. endif()
  477. if(VCMI_PORTMASTER)
  478. target_compile_definitions(vcmiclientcommon PRIVATE VCMI_PORTMASTER)
  479. endif()
  480. vcmi_set_output_dir(vcmiclientcommon "")
  481. enable_pch(vcmiclientcommon)