cmake_minimum_required(VERSION 3.16) project(filmtoro VERSION 0.1 LANGUAGES CXX) set(CMAKE_CXX_STANDARD_REQUIRED ON) find_package(Qt6 6.5 REQUIRED COMPONENTS Quick) find_package(Qt6 6.5 REQUIRED COMPONENTS WebView) qt_standard_project_setup(REQUIRES 6.5) qt_add_executable(appfilmtoro main.cpp ) # https://discourse.cmake.org/t/how-to-incorporate-app-icon-files-for-ios-into-xcode-14/7386/2 macro(qt_ios_set_xcode_property TARGET XCODE_PROPERTY XCODE_VALUE XCODE_RELVERSION) set(XCODE_RELVERSION_I "${XCODE_RELVERSION}") if(XCODE_RELVERSION_I STREQUAL "All") set_property(TARGET appfilmtoro PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY} "${XCODE_VALUE}") else() set_property(TARGET appfilmtoro PROPERTY XCODE_ATTRIBUTE_${XCODE_PROPERTY}[variant=${XCODE_RELVERSION_I}] "${XCODE_VALUE}") endif() endmacro() # qt_ios_set_xcode_property #APPLE Icons # Asset catalog root target_sources(appfilmtoro PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/ios/MyAppIcons.xcassets") set_source_files_properties("${CMAKE_CURRENT_SOURCE_DIR}/ios/MyAppIcons.xcassets" PROPERTIES MACOSX_PACKAGE_LOCATION Resources ) # Asset catalog app icon set list(APPEND app_icon_set "${CMAKE_CURRENT_SOURCE_DIR}/ios/MyAppIcons.xcassets/AppIcon.appiconset") list(APPEND app_icon_set "${CMAKE_CURRENT_SOURCE_DIR}/ios/MyAppIcons.xcassets/Contents.json") set_source_files_properties(${app_icon_set} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/MyAppIcons.xcassets ) # Asset catalog icon files file(GLOB app_icon_files CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/ios/MyAppIcons.xcassets/AppIcon.appiconset/*.png") list(APPEND app_icon_files "${CMAKE_CURRENT_SOURCE_DIR}/ios/MyAppIcons.xcassets/AppIcon.appiconset/Contents.json") set_source_files_properties(${app_icon_set} PROPERTIES MACOSX_PACKAGE_LOCATION Resources/MyAppIcons.xcassets/AppIcon.appiconset ) qt_add_qml_module(appfilmtoro URI filmtoro VERSION 1.0 QML_FILES Main.qml InitialScreen.qml BlogDetail.qml TitleDetail.qml SearchResults.qml SimilarTitles.qml JavaScript_API.js RESOURCES android/AndroidManifest.xml ios/Info.plist.in #ios/LaunchScreen.storyboard resources/images/filmtoro-white-icon.svg resources/images/searchIcon.png ) # Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1. # If you are developing for iOS or macOS you should consider setting an # explicit, fixed bundle identifier manually though. set_target_properties(appfilmtoro PROPERTIES WIN32_EXECUTABLE TRUE MACOSX_BUNDLE TRUE MACOSX_BUNDLE_GUI_IDENTIFIER com.xxxxxx.yyyyyy MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION} MACOSX_BUNDLE_SHORT_VERSION_STRING ${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR} MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/ios/Info.plist.in" #QT_IOS_LAUNCH_SCREEN "${CMAKE_CURRENT_SOURCE_DIR}/ios/LaunchScreen.storyboard" ) target_link_libraries(appfilmtoro PRIVATE Qt6::Quick PRIVATE Qt6::WebView ) include(GNUInstallDirs) install(TARGETS appfilmtoro BUNDLE DESTINATION . LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ) if (ANDROID) set_target_properties(appfilmtoro PROPERTIES QT_ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android") # https://bugreports.qt.io/browse/QTBUG-110326 # set_target_properties(${PROJECT} PROPERTIES QT_ANDROID_TARGET_SDK_VERSION 29) # qt_android_generate_deployment_settings(${PROJECT}) # include(C:/Qt/Tools/AndroidSDK/android_openssl-master/CMakeLists.txt) # set_target_properties(appfilmtoro PROPERTIES QT_ANDROID_EXTRA_LIBS "${ANDROID_EXTRA_LIBS}") endif()