CMakeLists.txt 12 KB

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