diff --git a/CMakeLists.txt b/CMakeLists.txt index a0355d928..968f76536 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,10 +48,18 @@ endif() set(VCMI_VERSION_MAJOR 1) set(VCMI_VERSION_MINOR 0) set(VCMI_VERSION_PATCH 0) +if(APPLE_IOS) + set(APP_SHORT_VERSION "${VCMI_VERSION_MAJOR}.${VCMI_VERSION_MINOR}") + if(NOT VCMI_VERSION_PATCH EQUAL 0) + string(APPEND APP_SHORT_VERSION ".${VCMI_VERSION_PATCH}") + endif() +endif() option(ENABLE_ERM "Enable compilation of ERM scripting module" OFF) option(ENABLE_LUA "Enable compilation of LUA scripting module" OFF) -if(NOT APPLE_IOS) +if(APPLE_IOS) + set(BUNDLE_IDENTIFIER_PREFIX "eu.vcmi" CACHE STRING "Bundle identifier prefix") +else() option(ENABLE_LAUNCHER "Enable compilation of launcher" ON) endif() option(ENABLE_TEST "Enable compilation of unit tests" ON) diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index 20b19af97..3c031e6ee 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -180,6 +180,8 @@ elseif(APPLE_IOS) "-framework Foundation -framework UIKit -framework QuartzCore -framework CoreGraphics -framework CoreServices -framework ImageIO" # SDL2_image ) + set_target_properties(vcmiclient PROPERTIES MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_LIST_DIR}/ios/Info.plist.in") + target_sources(vcmiclient PRIVATE ${CMAKE_SOURCE_DIR}/client/LaunchScreen.storyboard) set_source_files_properties(${CMAKE_SOURCE_DIR}/client/LaunchScreen.storyboard PROPERTIES MACOSX_PACKAGE_LOCATION "Resources") endif() diff --git a/Info.plist b/client/ios/Info.plist.in similarity index 60% rename from Info.plist rename to client/ios/Info.plist.in index fd7ef47e7..e50e209ff 100644 --- a/Info.plist +++ b/client/ios/Info.plist.in @@ -2,14 +2,12 @@ - BuildMachineOSBuild - 19H524 CFBundleDevelopmentRegion - English + en CFBundleExecutable vcmiclient CFBundleIdentifier - eu.vcmi.client + @BUNDLE_IDENTIFIER_PREFIX@.vcmiclient CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -17,52 +15,33 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + @APP_SHORT_VERSION@ CFBundleSignature ???? - CFBundleSupportedPlatforms - - iPhoneOS - CFBundleVersion 1 - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 17H22 - DTPlatformName - iphoneos - DTPlatformVersion - 13.7 - DTSDKBuild - 17H22 - DTSDKName - iphoneos13.7 - DTXcode - 1170 - DTXcodeBuild - 11E801a - MinimumOSVersion - 11.0 + LSRequiresIPhoneOS + NSAppTransportSecurity NSAllowsArbitraryLoads - UIDeviceFamily - - 2 - UIFileSharingEnabled UILaunchStoryboardName LaunchScreen UIRequiredDeviceCapabilities - arm64 - metal + armv7 + opengles-2 UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad UIInterfaceOrientationLandscapeLeft UIInterfaceOrientationLandscapeRight diff --git a/configure_ios.sh b/configure_ios.sh index 93153f630..f8f8049a6 100755 --- a/configure_ios.sh +++ b/configure_ios.sh @@ -6,7 +6,7 @@ sdlLibsDir=~/dev/ios/vcmi-ios-deps/SDL2-lib srcDir="../vcmi" /Users/Shared/xbmc-depends/x86_64-darwin19.6.0-native/bin/cmake "$srcDir" -G Xcode \ - -DENABLE_LAUNCHER=0 \ + -DBUNDLE_IDENTIFIER_PREFIX=com.kambala \ -Wno-dev \ -DCMAKE_TOOLCHAIN_FILE="$srcDir/ios.toolchain.cmake" \ -DPLATFORM=${1:-OS64} \ diff --git a/package_ios.sh b/package_ios.sh index 5240b74a1..ec3dadf1b 100755 --- a/package_ios.sh +++ b/package_ios.sh @@ -25,11 +25,6 @@ done mv -f *.dylib Frameworks popd -for app in vcmiclient vcmiserver; do - cp -f ../vcmi/Info.plist "$productsDir/$app.app" -done -sed -i '' -e 's/client/server/g' -e 's/>VCMIVCMI server + + + + CFBundleDevelopmentRegion + en + CFBundleExecutable + vcmiserver + CFBundleIdentifier + @BUNDLE_IDENTIFIER_PREFIX@.vcmiserver + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + VCMI server + CFBundlePackageType + APPL + CFBundleShortVersionString + @APP_SHORT_VERSION@ + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + NSAppTransportSecurity + + NSAllowsArbitraryLoads + + + UIFileSharingEnabled + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortrait + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + + + diff --git a/server/main_ios.mm b/server/ios/main.mm similarity index 100% rename from server/main_ios.mm rename to server/ios/main.mm