CMakeLists.txt 15 KB

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