CMakeLists.txt 12 KB

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