CMakeLists.txt 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586
  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. 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/CAnimation.cpp
  78. render/CBitmapHandler.cpp
  79. render/CDefFile.cpp
  80. render/Canvas.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/CBitmapHanFont.cpp
  88. renderSDL/CTrueTypeFont.cpp
  89. renderSDL/CursorHardware.cpp
  90. renderSDL/CursorSoftware.cpp
  91. renderSDL/ImageScaled.cpp
  92. renderSDL/RenderHandler.cpp
  93. renderSDL/SDLImage.cpp
  94. renderSDL/SDLImageLoader.cpp
  95. renderSDL/SDLRWwrapper.cpp
  96. renderSDL/ScreenHandler.cpp
  97. renderSDL/SDL_Extensions.cpp
  98. globalLobby/GlobalLobbyClient.cpp
  99. globalLobby/GlobalLobbyInviteWindow.cpp
  100. globalLobby/GlobalLobbyLoginWindow.cpp
  101. globalLobby/GlobalLobbyRoomWindow.cpp
  102. globalLobby/GlobalLobbyServerSetup.cpp
  103. globalLobby/GlobalLobbyWidget.cpp
  104. globalLobby/GlobalLobbyWindow.cpp
  105. widgets/Buttons.cpp
  106. widgets/CArtPlace.cpp
  107. widgets/CComponent.cpp
  108. widgets/CExchangeController.cpp
  109. widgets/CGarrisonInt.cpp
  110. widgets/CreatureCostBox.cpp
  111. widgets/ComboBox.cpp
  112. widgets/CTextInput.cpp
  113. widgets/GraphicalPrimitiveCanvas.cpp
  114. widgets/Images.cpp
  115. widgets/MiscWidgets.cpp
  116. widgets/ObjectLists.cpp
  117. widgets/TextControls.cpp
  118. widgets/Scrollable.cpp
  119. widgets/Slider.cpp
  120. widgets/CArtifactsOfHeroBase.cpp
  121. widgets/CArtifactsOfHeroMain.cpp
  122. widgets/CArtifactsOfHeroKingdom.cpp
  123. widgets/CArtifactsOfHeroAltar.cpp
  124. widgets/CArtifactsOfHeroMarket.cpp
  125. widgets/CArtifactsOfHeroBackpack.cpp
  126. widgets/RadialMenu.cpp
  127. widgets/VideoWidget.cpp
  128. widgets/markets/CAltarArtifacts.cpp
  129. widgets/markets/CAltarCreatures.cpp
  130. widgets/markets/CArtifactsBuying.cpp
  131. widgets/markets/CArtifactsSelling.cpp
  132. widgets/markets/CFreelancerGuild.cpp
  133. widgets/markets/CMarketResources.cpp
  134. widgets/markets/CTransferResources.cpp
  135. widgets/markets/CMarketBase.cpp
  136. widgets/markets/TradePanels.cpp
  137. windows/CCastleInterface.cpp
  138. windows/CCreatureWindow.cpp
  139. windows/CExchangeWindow.cpp
  140. windows/CHeroOverview.cpp
  141. windows/CHeroWindow.cpp
  142. windows/CKingdomInterface.cpp
  143. windows/CMapOverview.cpp
  144. windows/CMarketWindow.cpp
  145. windows/CMessage.cpp
  146. windows/CPuzzleWindow.cpp
  147. windows/CQuestLog.cpp
  148. windows/CSpellWindow.cpp
  149. windows/CTutorialWindow.cpp
  150. windows/CWindowObject.cpp
  151. windows/CreaturePurchaseCard.cpp
  152. windows/GUIClasses.cpp
  153. windows/InfoWindows.cpp
  154. windows/QuickRecruitmentWindow.cpp
  155. windows/CHeroBackpackWindow.cpp
  156. windows/CWindowWithArtifacts.cpp
  157. windows/settings/GeneralOptionsTab.cpp
  158. windows/settings/OtherOptionsTab.cpp
  159. windows/settings/SettingsMainWindow.cpp
  160. windows/settings/BattleOptionsTab.cpp
  161. windows/settings/AdventureOptionsTab.cpp
  162. xBRZ/xbrz.cpp
  163. ArtifactsUIController.cpp
  164. CGameInfo.cpp
  165. CMT.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(client_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/CAnimation.h
  264. render/CBitmapHandler.h
  265. render/CDefFile.h
  266. render/Canvas.h
  267. render/ColorFilter.h
  268. render/Colors.h
  269. render/EFont.h
  270. render/Graphics.h
  271. render/ICursor.h
  272. render/IFont.h
  273. render/IImage.h
  274. render/IImageLoader.h
  275. render/ImageLocator.h
  276. render/IRenderHandler.h
  277. render/IScreenHandler.h
  278. renderSDL/CBitmapFont.h
  279. renderSDL/CBitmapHanFont.h
  280. renderSDL/CTrueTypeFont.h
  281. renderSDL/CursorHardware.h
  282. renderSDL/CursorSoftware.h
  283. renderSDL/ImageScaled.h
  284. renderSDL/RenderHandler.h
  285. renderSDL/SDLImage.h
  286. renderSDL/SDLImageLoader.h
  287. renderSDL/SDLRWwrapper.h
  288. renderSDL/ScreenHandler.h
  289. renderSDL/SDL_Extensions.h
  290. renderSDL/SDL_PixelAccess.h
  291. globalLobby/GlobalLobbyClient.h
  292. globalLobby/GlobalLobbyDefines.h
  293. globalLobby/GlobalLobbyInviteWindow.h
  294. globalLobby/GlobalLobbyLoginWindow.h
  295. globalLobby/GlobalLobbyRoomWindow.h
  296. globalLobby/GlobalLobbyServerSetup.h
  297. globalLobby/GlobalLobbyObserver.h
  298. globalLobby/GlobalLobbyWidget.h
  299. globalLobby/GlobalLobbyWindow.h
  300. widgets/Buttons.h
  301. widgets/CArtPlace.h
  302. widgets/CComponent.h
  303. widgets/CExchangeController.h
  304. widgets/CGarrisonInt.h
  305. widgets/CreatureCostBox.h
  306. widgets/ComboBox.h
  307. widgets/CTextInput.h
  308. widgets/GraphicalPrimitiveCanvas.h
  309. widgets/Images.h
  310. widgets/MiscWidgets.h
  311. widgets/ObjectLists.h
  312. widgets/TextControls.h
  313. widgets/Scrollable.h
  314. widgets/Slider.h
  315. widgets/CArtifactsOfHeroBase.h
  316. widgets/CArtifactsOfHeroMain.h
  317. widgets/CArtifactsOfHeroKingdom.h
  318. widgets/CArtifactsOfHeroAltar.h
  319. widgets/CArtifactsOfHeroMarket.h
  320. widgets/CArtifactsOfHeroBackpack.h
  321. widgets/RadialMenu.h
  322. widgets/VideoWidget.h
  323. widgets/markets/CAltarArtifacts.h
  324. widgets/markets/CAltarCreatures.h
  325. widgets/markets/CArtifactsBuying.h
  326. widgets/markets/CArtifactsSelling.h
  327. widgets/markets/CFreelancerGuild.h
  328. widgets/markets/CMarketResources.h
  329. widgets/markets/CTransferResources.h
  330. widgets/markets/CMarketBase.h
  331. widgets/markets/TradePanels.h
  332. windows/CCastleInterface.h
  333. windows/CCreatureWindow.h
  334. windows/CExchangeWindow.h
  335. windows/CHeroOverview.h
  336. windows/CHeroWindow.h
  337. windows/CKingdomInterface.h
  338. windows/CMessage.h
  339. windows/CMapOverview.h
  340. windows/CMarketWindow.h
  341. windows/CPuzzleWindow.h
  342. windows/CQuestLog.h
  343. windows/CSpellWindow.h
  344. windows/CTutorialWindow.h
  345. windows/CWindowObject.h
  346. windows/CreaturePurchaseCard.h
  347. windows/GUIClasses.h
  348. windows/InfoWindows.h
  349. windows/QuickRecruitmentWindow.h
  350. windows/CHeroBackpackWindow.h
  351. windows/CWindowWithArtifacts.h
  352. windows/settings/GeneralOptionsTab.h
  353. windows/settings/OtherOptionsTab.h
  354. windows/settings/SettingsMainWindow.h
  355. windows/settings/BattleOptionsTab.h
  356. windows/settings/AdventureOptionsTab.h
  357. xBRZ/xbrz.h
  358. xBRZ/xbrz_tools.h
  359. ArtifactsUIController.h
  360. CGameInfo.h
  361. CMT.h
  362. CPlayerInterface.h
  363. PlayerLocalState.h
  364. CServerHandler.h
  365. Client.h
  366. ClientCommandManager.h
  367. ClientNetPackVisitors.h
  368. ConditionalWait.h
  369. HeroMovementController.h
  370. GameChatHandler.h
  371. LobbyClientNetPackVisitors.h
  372. ServerRunner.h
  373. resource.h
  374. )
  375. if(APPLE_IOS)
  376. set(client_SRCS ${client_SRCS}
  377. CFocusableHelper.cpp
  378. ios/GameChatKeyboardHandler.m
  379. ios/main.m
  380. ios/startSDL.mm
  381. ios/utils.mm
  382. )
  383. set(client_HEADERS ${client_HEADERS}
  384. CFocusableHelper.h
  385. ios/GameChatKeyboardHandler.h
  386. ios/startSDL.h
  387. ios/utils.h
  388. )
  389. endif()
  390. assign_source_group(${client_SRCS} ${client_HEADERS} VCMI_client.rc)
  391. if(ANDROID)
  392. add_library(vcmiclient SHARED ${client_SRCS} ${client_HEADERS})
  393. set_target_properties(vcmiclient PROPERTIES
  394. OUTPUT_NAME "vcmiclient_${ANDROID_ABI}" # required by Qt
  395. )
  396. else()
  397. add_executable(vcmiclient ${client_SRCS} ${client_HEADERS})
  398. endif()
  399. if(NOT ENABLE_STATIC_LIBS)
  400. add_dependencies(vcmiclient
  401. BattleAI
  402. EmptyAI
  403. StupidAI
  404. VCAI
  405. )
  406. if(ENABLE_NULLKILLER_AI)
  407. add_dependencies(vcmiclient Nullkiller)
  408. endif()
  409. endif()
  410. if(APPLE_IOS)
  411. if(ENABLE_ERM)
  412. add_dependencies(vcmiclient vcmiERM)
  413. endif()
  414. if(ENABLE_LUA)
  415. add_dependencies(vcmiclient vcmiLua)
  416. endif()
  417. endif()
  418. if(WIN32)
  419. target_sources(vcmiclient PRIVATE "VCMI_client.rc")
  420. set_target_properties(vcmiclient
  421. PROPERTIES
  422. OUTPUT_NAME "VCMI_client"
  423. PROJECT_LABEL "VCMI_client"
  424. )
  425. set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT vcmiclient)
  426. if(NOT ENABLE_DEBUG_CONSOLE)
  427. set_target_properties(vcmiclient PROPERTIES WIN32_EXECUTABLE)
  428. target_link_libraries(vcmiclient SDL2::SDL2main)
  429. endif()
  430. target_compile_definitions(vcmiclient PRIVATE WINDOWS_IGNORE_PACKING_MISMATCH)
  431. # TODO: very hacky, find proper solution to copy AI dlls into bin dir
  432. if(MSVC)
  433. add_custom_command(TARGET vcmiclient POST_BUILD
  434. WORKING_DIRECTORY "$<TARGET_FILE_DIR:vcmiclient>"
  435. COMMAND ${CMAKE_COMMAND} -E copy AI/fuzzylite.dll fuzzylite.dll
  436. COMMAND ${CMAKE_COMMAND} -E copy AI/tbb12.dll tbb12.dll
  437. )
  438. endif()
  439. elseif(APPLE_IOS)
  440. target_link_libraries(vcmiclient PRIVATE
  441. iOS_utils
  442. # FFmpeg
  443. bz2
  444. iconv
  445. z
  446. "-framework AudioToolbox"
  447. "-framework AVFoundation"
  448. "-framework CoreMedia"
  449. "-framework VideoToolbox"
  450. )
  451. set_target_properties(vcmiclient PROPERTIES
  452. MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/ios/Info.plist"
  453. XCODE_ATTRIBUTE_LD_RUNPATH_SEARCH_PATHS "@executable_path/Frameworks"
  454. XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED "$(CODE_SIGNING_ALLOWED_FOR_APPS)"
  455. XCODE_ATTRIBUTE_ASSETCATALOG_COMPILER_APPICON_NAME AppIcon
  456. )
  457. foreach(XCODE_RESOURCE LaunchScreen.storyboard Images.xcassets Settings.bundle vcmi_logo.png)
  458. set(XCODE_RESOURCE_PATH ios/${XCODE_RESOURCE})
  459. target_sources(vcmiclient PRIVATE ${XCODE_RESOURCE_PATH})
  460. set_source_files_properties(${XCODE_RESOURCE_PATH} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
  461. # workaround to prevent CMAKE_SKIP_PRECOMPILE_HEADERS being added as compile flag
  462. if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.22.0" AND CMAKE_VERSION VERSION_LESS "3.25.0")
  463. set_source_files_properties(${XCODE_RESOURCE_PATH} PROPERTIES LANGUAGE CXX)
  464. endif()
  465. endforeach()
  466. set(CMAKE_EXE_LINKER_FLAGS "-Wl,-e,_client_main")
  467. endif()
  468. target_link_libraries(vcmiclient PRIVATE vcmiservercommon)
  469. if(ENABLE_SINGLE_APP_BUILD AND ENABLE_LAUNCHER)
  470. target_link_libraries(vcmiclient PRIVATE vcmilauncher)
  471. endif()
  472. target_link_libraries(vcmiclient PRIVATE
  473. vcmi SDL2::SDL2 SDL2::Image SDL2::Mixer SDL2::TTF
  474. )
  475. if(ffmpeg_LIBRARIES)
  476. target_link_libraries(vcmiclient PRIVATE
  477. ${ffmpeg_LIBRARIES}
  478. )
  479. else()
  480. target_compile_definitions(vcmiclient PRIVATE DISABLE_VIDEO)
  481. endif()
  482. target_include_directories(vcmiclient PUBLIC
  483. ${CMAKE_CURRENT_SOURCE_DIR}
  484. )
  485. if (ffmpeg_INCLUDE_DIRS)
  486. target_include_directories(vcmiclient PRIVATE
  487. ${ffmpeg_INCLUDE_DIRS}
  488. )
  489. endif()
  490. vcmi_set_output_dir(vcmiclient "")
  491. enable_pch(vcmiclient)
  492. if(APPLE_IOS)
  493. vcmi_install_conan_deps("\${CMAKE_INSTALL_PREFIX}")
  494. add_custom_command(TARGET vcmiclient POST_BUILD
  495. COMMAND ios/set_build_version.sh "$<TARGET_BUNDLE_CONTENT_DIR:vcmiclient>"
  496. COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --component "${CMAKE_INSTALL_DEFAULT_COMPONENT_NAME}" --config "$<CONFIG>" --prefix "$<TARGET_BUNDLE_CONTENT_DIR:vcmiclient>"
  497. COMMAND ios/rpath_remove_symlinks.sh
  498. COMMAND ios/codesign.sh
  499. WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  500. )
  501. install(TARGETS vcmiclient DESTINATION Payload COMPONENT app) # for ipa generation with cpack
  502. elseif(ANDROID)
  503. find_program(androidDeployQt androiddeployqt
  504. PATHS "${qtBinDir}"
  505. )
  506. vcmi_install_conan_deps("\${CMAKE_INSTALL_PREFIX}/${LIB_DIR}")
  507. add_custom_target(android_deploy ALL
  508. COMMAND ${CMAKE_COMMAND} --install "${CMAKE_BINARY_DIR}" --config "$<CONFIG>" --prefix "${androidQtBuildDir}"
  509. COMMAND "${androidDeployQt}" --input "${CMAKE_BINARY_DIR}/androiddeployqt.json" --output "${androidQtBuildDir}" --android-platform "android-${ANDROID_TARGET_SDK_VERSION}" --verbose $<$<NOT:$<CONFIG:Debug>>:--release> ${ANDROIDDEPLOYQT_OPTIONS}
  510. COMMAND_EXPAND_LISTS
  511. VERBATIM
  512. COMMENT "Create android package"
  513. )
  514. add_dependencies(android_deploy vcmiclient)
  515. else()
  516. install(TARGETS vcmiclient DESTINATION ${BIN_DIR})
  517. endif()
  518. #install icons and desktop file on Linux
  519. if(NOT WIN32 AND NOT APPLE AND NOT ANDROID)
  520. #FIXME: move to client makefile?
  521. foreach(iconSize 16 22 32 48 64 128 256 512 1024 2048)
  522. install(FILES "icons/vcmiclient.${iconSize}x${iconSize}.png"
  523. DESTINATION "share/icons/hicolor/${iconSize}x${iconSize}/apps"
  524. RENAME vcmiclient.png
  525. )
  526. endforeach()
  527. install(FILES icons/vcmiclient.svg
  528. DESTINATION share/icons/hicolor/scalable/apps
  529. RENAME vcmiclient.svg
  530. )
  531. install(FILES icons/vcmiclient.desktop
  532. DESTINATION share/applications
  533. )
  534. endif()