CMakeLists.txt 13 KB

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