CMakeLists.txt 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584
  1. set(client_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. mapView/MapRenderer.cpp
  63. mapView/MapRendererContext.cpp
  64. mapView/MapRendererContextState.cpp
  65. mapView/MapView.cpp
  66. mapView/MapViewActions.cpp
  67. mapView/MapViewCache.cpp
  68. mapView/MapViewController.cpp
  69. mapView/MapViewModel.cpp
  70. mapView/mapHandler.cpp
  71. mapView/MapOverlayLogVisualizer.cpp
  72. media/CAudioBase.cpp
  73. media/CMusicHandler.cpp
  74. media/CSoundHandler.cpp
  75. media/CVideoHandler.cpp
  76. render/CAnimation.cpp
  77. render/CBitmapHandler.cpp
  78. render/CDefFile.cpp
  79. render/Canvas.cpp
  80. render/ColorFilter.cpp
  81. render/Colors.cpp
  82. render/Graphics.cpp
  83. render/IFont.cpp
  84. render/ImageLocator.cpp
  85. renderSDL/CBitmapFont.cpp
  86. renderSDL/CBitmapHanFont.cpp
  87. renderSDL/CTrueTypeFont.cpp
  88. renderSDL/CursorHardware.cpp
  89. renderSDL/CursorSoftware.cpp
  90. renderSDL/ImageScaled.cpp
  91. renderSDL/RenderHandler.cpp
  92. renderSDL/SDLImage.cpp
  93. renderSDL/SDLImageLoader.cpp
  94. renderSDL/SDLRWwrapper.cpp
  95. renderSDL/ScreenHandler.cpp
  96. renderSDL/SDL_Extensions.cpp
  97. globalLobby/GlobalLobbyClient.cpp
  98. globalLobby/GlobalLobbyInviteWindow.cpp
  99. globalLobby/GlobalLobbyLoginWindow.cpp
  100. globalLobby/GlobalLobbyRoomWindow.cpp
  101. globalLobby/GlobalLobbyServerSetup.cpp
  102. globalLobby/GlobalLobbyWidget.cpp
  103. globalLobby/GlobalLobbyWindow.cpp
  104. widgets/Buttons.cpp
  105. widgets/CArtPlace.cpp
  106. widgets/CComponent.cpp
  107. widgets/CExchangeController.cpp
  108. widgets/CGarrisonInt.cpp
  109. widgets/CreatureCostBox.cpp
  110. widgets/ComboBox.cpp
  111. widgets/CTextInput.cpp
  112. widgets/GraphicalPrimitiveCanvas.cpp
  113. widgets/Images.cpp
  114. widgets/MiscWidgets.cpp
  115. widgets/ObjectLists.cpp
  116. widgets/TextControls.cpp
  117. widgets/Scrollable.cpp
  118. widgets/Slider.cpp
  119. widgets/CArtifactsOfHeroBase.cpp
  120. widgets/CArtifactsOfHeroMain.cpp
  121. widgets/CArtifactsOfHeroKingdom.cpp
  122. widgets/CArtifactsOfHeroAltar.cpp
  123. widgets/CArtifactsOfHeroMarket.cpp
  124. widgets/CArtifactsOfHeroBackpack.cpp
  125. widgets/RadialMenu.cpp
  126. widgets/VideoWidget.cpp
  127. widgets/markets/CAltarArtifacts.cpp
  128. widgets/markets/CAltarCreatures.cpp
  129. widgets/markets/CArtifactsBuying.cpp
  130. widgets/markets/CArtifactsSelling.cpp
  131. widgets/markets/CFreelancerGuild.cpp
  132. widgets/markets/CMarketResources.cpp
  133. widgets/markets/CTransferResources.cpp
  134. widgets/markets/CMarketBase.cpp
  135. widgets/markets/TradePanels.cpp
  136. windows/CCastleInterface.cpp
  137. windows/CCreatureWindow.cpp
  138. windows/CExchangeWindow.cpp
  139. windows/CHeroOverview.cpp
  140. windows/CHeroWindow.cpp
  141. windows/CKingdomInterface.cpp
  142. windows/CMapOverview.cpp
  143. windows/CMarketWindow.cpp
  144. windows/CMessage.cpp
  145. windows/CPuzzleWindow.cpp
  146. windows/CQuestLog.cpp
  147. windows/CSpellWindow.cpp
  148. windows/CTutorialWindow.cpp
  149. windows/CWindowObject.cpp
  150. windows/CreaturePurchaseCard.cpp
  151. windows/GUIClasses.cpp
  152. windows/InfoWindows.cpp
  153. windows/QuickRecruitmentWindow.cpp
  154. windows/CHeroBackpackWindow.cpp
  155. windows/CWindowWithArtifacts.cpp
  156. windows/settings/GeneralOptionsTab.cpp
  157. windows/settings/OtherOptionsTab.cpp
  158. windows/settings/SettingsMainWindow.cpp
  159. windows/settings/BattleOptionsTab.cpp
  160. windows/settings/AdventureOptionsTab.cpp
  161. xBRZ/xbrz.cpp
  162. ArtifactsUIController.cpp
  163. CGameInfo.cpp
  164. CMT.cpp
  165. CPlayerInterface.cpp
  166. PlayerLocalState.cpp
  167. CServerHandler.cpp
  168. Client.cpp
  169. ClientCommandManager.cpp
  170. GameChatHandler.cpp
  171. HeroMovementController.cpp
  172. NetPacksClient.cpp
  173. NetPacksLobbyClient.cpp
  174. ServerRunner.cpp
  175. )
  176. set(client_HEADERS
  177. StdInc.h
  178. adventureMap/AdventureMapInterface.h
  179. adventureMap/AdventureMapShortcuts.h
  180. adventureMap/AdventureMapWidget.h
  181. adventureMap/AdventureState.h
  182. adventureMap/AdventureOptions.h
  183. adventureMap/CInGameConsole.h
  184. adventureMap/CInfoBar.h
  185. adventureMap/CList.h
  186. adventureMap/CMinimap.h
  187. adventureMap/CResDataBar.h
  188. adventureMap/MapAudioPlayer.h
  189. adventureMap/TurnTimerWidget.h
  190. battle/BattleActionsController.h
  191. battle/BattleAnimationClasses.h
  192. battle/BattleConstants.h
  193. battle/BattleEffectsController.h
  194. battle/BattleFieldController.h
  195. battle/BattleInterface.h
  196. battle/BattleInterfaceClasses.h
  197. battle/BattleObstacleController.h
  198. battle/BattleProjectileController.h
  199. battle/BattleRenderer.h
  200. battle/BattleSiegeController.h
  201. battle/BattleStacksController.h
  202. battle/BattleWindow.h
  203. battle/CreatureAnimation.h
  204. battle/BattleOverlayLogVisualizer.h
  205. eventsSDL/NotificationHandler.h
  206. eventsSDL/InputHandler.h
  207. eventsSDL/InputSourceKeyboard.h
  208. eventsSDL/InputSourceMouse.h
  209. eventsSDL/InputSourceText.h
  210. eventsSDL/InputSourceTouch.h
  211. eventsSDL/InputSourceGameController.h
  212. gui/CGuiHandler.h
  213. gui/CIntObject.h
  214. gui/CursorHandler.h
  215. gui/EventDispatcher.h
  216. gui/EventsReceiver.h
  217. gui/InterfaceObjectConfigurable.h
  218. gui/FramerateManager.h
  219. gui/MouseButton.h
  220. gui/Shortcut.h
  221. gui/ShortcutHandler.h
  222. gui/TextAlignment.h
  223. gui/WindowHandler.h
  224. lobby/CBonusSelection.h
  225. lobby/CCampaignInfoScreen.h
  226. lobby/CLobbyScreen.h
  227. lobby/CSavingScreen.h
  228. lobby/CScenarioInfoScreen.h
  229. lobby/CSelectionBase.h
  230. lobby/TurnOptionsTab.h
  231. lobby/ExtraOptionsTab.h
  232. lobby/OptionsTab.h
  233. lobby/OptionsTabBase.h
  234. lobby/RandomMapTab.h
  235. lobby/SelectionTab.h
  236. mainmenu/CCampaignScreen.h
  237. mainmenu/CMainMenu.h
  238. mainmenu/CPrologEpilogVideo.h
  239. mainmenu/CreditsScreen.h
  240. mainmenu/CHighScoreScreen.h
  241. mapView/IMapRendererContext.h
  242. mapView/IMapRendererObserver.h
  243. mapView/MapRenderer.h
  244. mapView/MapRendererContext.h
  245. mapView/MapRendererContextState.h
  246. mapView/MapView.h
  247. mapView/MapViewActions.h
  248. mapView/MapViewCache.h
  249. mapView/MapViewController.h
  250. mapView/MapViewModel.h
  251. mapView/mapHandler.h
  252. mapView/MapOverlayLogVisualizer.h
  253. media/CAudioBase.h
  254. media/CEmptyVideoPlayer.h
  255. media/CMusicHandler.h
  256. media/CSoundHandler.h
  257. media/CVideoHandler.h
  258. media/IMusicPlayer.h
  259. media/ISoundPlayer.h
  260. media/IVideoPlayer.h
  261. render/CAnimation.h
  262. render/CBitmapHandler.h
  263. render/CDefFile.h
  264. render/Canvas.h
  265. render/ColorFilter.h
  266. render/Colors.h
  267. render/EFont.h
  268. render/Graphics.h
  269. render/ICursor.h
  270. render/IFont.h
  271. render/IImage.h
  272. render/IImageLoader.h
  273. render/ImageLocator.h
  274. render/IRenderHandler.h
  275. render/IScreenHandler.h
  276. renderSDL/CBitmapFont.h
  277. renderSDL/CBitmapHanFont.h
  278. renderSDL/CTrueTypeFont.h
  279. renderSDL/CursorHardware.h
  280. renderSDL/CursorSoftware.h
  281. renderSDL/ImageScaled.h
  282. renderSDL/RenderHandler.h
  283. renderSDL/SDLImage.h
  284. renderSDL/SDLImageLoader.h
  285. renderSDL/SDLRWwrapper.h
  286. renderSDL/ScreenHandler.h
  287. renderSDL/SDL_Extensions.h
  288. renderSDL/SDL_PixelAccess.h
  289. globalLobby/GlobalLobbyClient.h
  290. globalLobby/GlobalLobbyDefines.h
  291. globalLobby/GlobalLobbyInviteWindow.h
  292. globalLobby/GlobalLobbyLoginWindow.h
  293. globalLobby/GlobalLobbyRoomWindow.h
  294. globalLobby/GlobalLobbyServerSetup.h
  295. globalLobby/GlobalLobbyObserver.h
  296. globalLobby/GlobalLobbyWidget.h
  297. globalLobby/GlobalLobbyWindow.h
  298. widgets/Buttons.h
  299. widgets/CArtPlace.h
  300. widgets/CComponent.h
  301. widgets/CExchangeController.h
  302. widgets/CGarrisonInt.h
  303. widgets/CreatureCostBox.h
  304. widgets/ComboBox.h
  305. widgets/CTextInput.h
  306. widgets/GraphicalPrimitiveCanvas.h
  307. widgets/Images.h
  308. widgets/MiscWidgets.h
  309. widgets/ObjectLists.h
  310. widgets/TextControls.h
  311. widgets/Scrollable.h
  312. widgets/Slider.h
  313. widgets/CArtifactsOfHeroBase.h
  314. widgets/CArtifactsOfHeroMain.h
  315. widgets/CArtifactsOfHeroKingdom.h
  316. widgets/CArtifactsOfHeroAltar.h
  317. widgets/CArtifactsOfHeroMarket.h
  318. widgets/CArtifactsOfHeroBackpack.h
  319. widgets/RadialMenu.h
  320. widgets/VideoWidget.h
  321. widgets/markets/CAltarArtifacts.h
  322. widgets/markets/CAltarCreatures.h
  323. widgets/markets/CArtifactsBuying.h
  324. widgets/markets/CArtifactsSelling.h
  325. widgets/markets/CFreelancerGuild.h
  326. widgets/markets/CMarketResources.h
  327. widgets/markets/CTransferResources.h
  328. widgets/markets/CMarketBase.h
  329. widgets/markets/TradePanels.h
  330. windows/CCastleInterface.h
  331. windows/CCreatureWindow.h
  332. windows/CExchangeWindow.h
  333. windows/CHeroOverview.h
  334. windows/CHeroWindow.h
  335. windows/CKingdomInterface.h
  336. windows/CMessage.h
  337. windows/CMapOverview.h
  338. windows/CMarketWindow.h
  339. windows/CPuzzleWindow.h
  340. windows/CQuestLog.h
  341. windows/CSpellWindow.h
  342. windows/CTutorialWindow.h
  343. windows/CWindowObject.h
  344. windows/CreaturePurchaseCard.h
  345. windows/GUIClasses.h
  346. windows/InfoWindows.h
  347. windows/QuickRecruitmentWindow.h
  348. windows/CHeroBackpackWindow.h
  349. windows/CWindowWithArtifacts.h
  350. windows/settings/GeneralOptionsTab.h
  351. windows/settings/OtherOptionsTab.h
  352. windows/settings/SettingsMainWindow.h
  353. windows/settings/BattleOptionsTab.h
  354. windows/settings/AdventureOptionsTab.h
  355. xBRZ/xbrz.h
  356. xBRZ/xbrz_tools.h
  357. ArtifactsUIController.h
  358. CGameInfo.h
  359. CMT.h
  360. CPlayerInterface.h
  361. PlayerLocalState.h
  362. CServerHandler.h
  363. Client.h
  364. ClientCommandManager.h
  365. ClientNetPackVisitors.h
  366. ConditionalWait.h
  367. HeroMovementController.h
  368. GameChatHandler.h
  369. LobbyClientNetPackVisitors.h
  370. ServerRunner.h
  371. resource.h
  372. )
  373. if(APPLE_IOS)
  374. set(client_SRCS ${client_SRCS}
  375. CFocusableHelper.cpp
  376. ios/GameChatKeyboardHandler.m
  377. ios/main.m
  378. ios/startSDL.mm
  379. ios/utils.mm
  380. )
  381. set(client_HEADERS ${client_HEADERS}
  382. CFocusableHelper.h
  383. ios/GameChatKeyboardHandler.h
  384. ios/startSDL.h
  385. ios/utils.h
  386. )
  387. endif()
  388. assign_source_group(${client_SRCS} ${client_HEADERS} VCMI_client.rc)
  389. if(ANDROID)
  390. add_library(vcmiclient SHARED ${client_SRCS} ${client_HEADERS})
  391. set_target_properties(vcmiclient PROPERTIES
  392. OUTPUT_NAME "vcmiclient_${ANDROID_ABI}" # required by Qt
  393. )
  394. else()
  395. add_executable(vcmiclient ${client_SRCS} ${client_HEADERS})
  396. endif()
  397. if(NOT ENABLE_STATIC_LIBS)
  398. add_dependencies(vcmiclient
  399. BattleAI
  400. EmptyAI
  401. StupidAI
  402. VCAI
  403. )
  404. if(ENABLE_NULLKILLER_AI)
  405. add_dependencies(vcmiclient Nullkiller)
  406. endif()
  407. endif()
  408. if(APPLE_IOS)
  409. if(ENABLE_ERM)
  410. add_dependencies(vcmiclient vcmiERM)
  411. endif()
  412. if(ENABLE_LUA)
  413. add_dependencies(vcmiclient vcmiLua)
  414. endif()
  415. endif()
  416. if(WIN32)
  417. target_sources(vcmiclient PRIVATE "VCMI_client.rc")
  418. set_target_properties(vcmiclient
  419. PROPERTIES
  420. OUTPUT_NAME "VCMI_client"
  421. PROJECT_LABEL "VCMI_client"
  422. )
  423. set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT vcmiclient)
  424. if(NOT ENABLE_DEBUG_CONSOLE)
  425. set_target_properties(vcmiclient PROPERTIES WIN32_EXECUTABLE)
  426. target_link_libraries(vcmiclient SDL2::SDL2main)
  427. endif()
  428. target_compile_definitions(vcmiclient PRIVATE WINDOWS_IGNORE_PACKING_MISMATCH)
  429. # TODO: very hacky, find proper solution to copy AI dlls into bin dir
  430. if(MSVC)
  431. add_custom_command(TARGET vcmiclient POST_BUILD
  432. WORKING_DIRECTORY "$<TARGET_FILE_DIR:vcmiclient>"
  433. COMMAND ${CMAKE_COMMAND} -E copy AI/fuzzylite.dll fuzzylite.dll
  434. COMMAND ${CMAKE_COMMAND} -E copy AI/tbb12.dll tbb12.dll
  435. )
  436. endif()
  437. elseif(APPLE_IOS)
  438. target_link_libraries(vcmiclient 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. set_target_properties(vcmiclient PROPERTIES
  450. MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/ios/Info.plist"
  451. XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks"
  452. XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "$(CODE_SIGNING_ALLOWED_FOR_APPS)"
  453. XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon
  454. )
  455. foreach(XCODE_RESOURCE LaunchScreen.storyboard Images.xcassets Settings.bundle vcmi_logo.png)
  456. set(XCODE_RESOURCE_PATH ios/${XCODE_RESOURCE})
  457. target_sources(vcmiclient PRIVATE ${XCODE_RESOURCE_PATH})
  458. set_source_files_properties(${XCODE_RESOURCE_PATH} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
  459. # workaround to prevent CMAKE_SKIP_PRECOMPILE_HEADERS being added as compile flag
  460. if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.22.0" AND CMAKE_VERSION VERSION_LESS "3.25.0")
  461. set_source_files_properties(${XCODE_RESOURCE_PATH} PROPERTIES LANGUAGE CXX)
  462. endif()
  463. endforeach()
  464. set(CMAKE_EXE_LINKER_FLAGS "-Wl,-e,_client_main")
  465. endif()
  466. target_link_libraries(vcmiclient PRIVATE vcmiservercommon)
  467. if(ENABLE_SINGLE_APP_BUILD AND ENABLE_LAUNCHER)
  468. target_link_libraries(vcmiclient PRIVATE vcmilauncher)
  469. endif()
  470. target_link_libraries(vcmiclient PRIVATE
  471. vcmi SDL2::SDL2 SDL2::Image SDL2::Mixer SDL2::TTF
  472. )
  473. if(ffmpeg_LIBRARIES)
  474. target_link_libraries(vcmiclient PRIVATE
  475. ${ffmpeg_LIBRARIES}
  476. )
  477. else()
  478. target_compile_definitions(vcmiclient PRIVATE DISABLE_VIDEO)
  479. endif()
  480. target_include_directories(vcmiclient PUBLIC
  481. ${CMAKE_CURRENT_SOURCE_DIR}
  482. )
  483. if (ffmpeg_INCLUDE_DIRS)
  484. target_include_directories(vcmiclient PRIVATE
  485. ${ffmpeg_INCLUDE_DIRS}
  486. )
  487. endif()
  488. vcmi_set_output_dir(vcmiclient "")
  489. enable_pch(vcmiclient)
  490. if(APPLE_IOS)
  491. vcmi_install_conan_deps("\${CMAKE_INSTALL_PREFIX}")
  492. add_custom_command(TARGET vcmiclient POST_BUILD
  493. COMMAND ios/set_build_version.sh "$<TARGET_BUNDLE_CONTENT_DIR:vcmiclient>"
  494. COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --component "${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}" --config "$<CONFIG>" --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiclient>"
  495. COMMAND ios/rpath_remove_symlinks.sh
  496. COMMAND ios/codesign.sh
  497. WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  498. )
  499. install(TARGETS vcmiclient DESTINATION Payload COMPONENT app) # for ipa generation with cpack
  500. elseif(ANDROID)
  501. find_program(androidDeployQt androiddeployqt
  502. PATHS "${qtBinDir}"
  503. )
  504. vcmi_install_conan_deps("\${CMAKE_INSTALL_PREFIX}/${LIB_DIR}")
  505. add_custom_target(android_deploy ALL
  506. COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "${androidQtBuildDir}"
  507. COMMAND "${androidDeployQt}" --input "${CMAKE_BINARY_DIR}/androiddeployqt.json" --output "${androidQtBuildDir}" --android-platform "android-${ANDROID_TARGET_SDK_VERSION}" --verbose $<$<NOT:$<CONFIG:Debug>>:--release> ${ANDROIDDEPLOYQT_OPTIONS}
  508. COMMAND_EXPAND_LISTS
  509. VERBATIM
  510. COMMENT "Create android package"
  511. )
  512. add_dependencies(android_deploy vcmiclient)
  513. else()
  514. install(TARGETS vcmiclient DESTINATION ${BIN_DIR})
  515. endif()
  516. #install icons and desktop file on Linux
  517. if(NOT WIN32 AND NOT APPLE AND NOT ANDROID)
  518. #FIXME: move to client makefile?
  519. foreach(iconSize 16 22 32 48 64 128 256 512 1024 2048)
  520. install(FILES "icons/vcmiclient.${iconSize}x${iconSize}.png"
  521. DESTINATION "share/icons/hicolor/${iconSize}x${iconSize}/apps"
  522. RENAME vcmiclient.png
  523. )
  524. endforeach()
  525. install(FILES icons/vcmiclient.svg
  526. DESTINATION share/icons/hicolor/scalable/apps
  527. RENAME vcmiclient.svg
  528. )
  529. install(FILES icons/vcmiclient.desktop
  530. DESTINATION share/applications
  531. )
  532. endif()