本文介绍: 目前关于ios qt的开发资料比较少,这里整理了几个比较重要的开发要点,基于MacOS14 + Xcode15 + Qt15.5 + cmake + iphone真机。实测设置OPENSSL_ROOT_DIR无效,这里可以手动指定相应的cmake变量,在FindOpenSSL.cmake做相应的修改。解决方法:在qmake构建步骤添加额外参数。并在CMakeLists.txt中添加。解决方法:添加cmake参数。
目前关于ios qt的开发资料比较少,这里整理了几个比较重要的开发要点,基于MacOS14 + Xcode15 + Qt5.15 + cmake + iphone真机。
CMake Error at /Users/user/Qt/5.15.5/ios/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:91 (message):
Library not found: MobileCoreServices
Call Stack (most recent call first):
/Users/user/Qt/5.15.5/ios/lib/cmake/Qt5Core/Qt5CoreConfig.cmake:263
(_qt5_Core_process_prl_file)
/Users/user/Qt/5.15.5/ios/lib/cmake/Qt5/Qt5Config.cmake:28 (find_package)
CMakeLists.txt:28 (find_package)
-DCMAKE_FIND_ROOT_PATH:STRING=%{Qt:QT_INSTALL_PREFIX}
-DCMAKE_SYSTEM_NAME=iOS
-DCMAKE_OSX_SYSROOT=iphoneos
-DCMAKE_OSX_ARCHITECTURES=arm64
if(IOS)
target_link_options(${user_project_target_name} PRIVATE "-Wl,-e,_qt_main_wrapper")
endif()
参考来源:https://bugreports.qt.io/browse/QTCREATORBUG-26121
Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
system variable OPENSSL_ROOT_DIR (missing: OPENSSL_INCLUDE_DIR)
实测设置OPENSSL_ROOT_DIR无效,这里可以手动指定相应的cmake变量,在FindOpenSSL.cmake做相应的修改。
FIND_PATH(OPENSSL_INCLUDE_DIR
NAMES
openssl/ssl.h
PATH_SUFFIXES
"include"
HINTS
${_OPENSSL_INCLUDEDIR}
${_OPENSSL_ROOT_HINTS_AND_PATHS}
PATH_SUFFIXES
include
)
# add for ios
IF(IOS AND NOT OPENSSL_INCLUDE_DIR)
set (OPENSSL_INCLUDE_DIR "/usr/local/opt/opensslios@1.1/include")
set (SSL_LIBRARY "/usr/local/opt/opensslios@1.1/lib/libssl.a")
set (CRYPTO_LIBRARY "/usr/local/opt/opensslios@1.1/lib/libcrypto.a")
list(APPEND OPENSSL_LIBRARIES ${CRYPTO_LIBRARY} ${SSL_LIBRARY})
ENDIF()
failed to parse default search paths from compiler output
-early QMAKE_DEFAULT_LIBDIRS=$(xcrun -show-sdk-path)/usr/lib
参考来源:https://bugreports.qt.io/browse/QTBUG-117225
set_target_properties(${MODULE_NAME} PROPERTIES RESOURCE "xxx.xcassets")
原文地址:https://blog.csdn.net/binzhongbi757/article/details/134565798
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。
如若转载,请注明出处:http://www.7code.cn/show_15395.html
如若内容造成侵权/违法违规/事实不符,请联系代码007邮箱:suwngjj01@126.com进行投诉反馈,一经查实,立即删除!
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。