加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

CMake链接了Qt6RemoteObject_debug的问题

(2022-11-07 14:58:16)
标签:

cmake

_debug

parsefile

addbuiltincommand

readdependentfile

分类: 计算机与 Internet
项目里用CMake,当引入Client-framework以后,发现Qt6的包引用了Qt6RemoteObjects_debug库,启动失败。
这个文件只在Qt/lib下有,Frameworks/Debug是对Frameworks/Release的引用。
所以想找是哪里引入这个_debug的,以前版本没有引用。
通过比对,发现是
/Users/conanchen/client-delivery/3P/QT/6.2.40/mac64_tls/lib/cmake/Qt6RemoteObjects/Qt6RemoteObjectsTargets-debug.cmake
当这个删除后就正常了,尝试刻意把这个改错,它也不报错。
通过调试CMake源码
# Import target "Qt6::RemoteObjects" for configuration "Debug"
set_property(TARGET Qt6::RemoteObjects APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(Qt6::RemoteObjects PROPERTIES
IMPORTED_LOCATION_DEBUG "${_IMPORT_PREFIX}/lib/QtRemoteObjects.framework/Versions/A/QtRemoteObjects_debug"
IMPORTED_SONAME_DEBUG "@rpath/QtRemoteObjects.framework/Versions/A/QtRemoteObjects_debug"
)
所以断点打在cmListFile::ParseFile,上条件断点,可以判断出加载这个文件。
strstr(filename, "Qt6RemoteObjects") != 0
CMake链接了Qt6RemoteObject_debug的问题
从call stack上cmState::AddBuiltinCommand,对应的参数,可以找到具体的引用行数。
CMake链接了Qt6RemoteObject_debug的问题
再向上bool cmMakefile::ReadDependentFile(const std::string& filename,
bool noPolicyScope)
可以找到哪个call导致引用这个-debug.cmake文件。
CMake链接了Qt6RemoteObject_debug的问题
综合第三点和第二点,第三点给出文件,第二点给出行号,就是上面的
/Users/conanchen/client-delivery/3P/QT/6.2.40/mac64_tls/lib/cmake/Qt6RemoteObjects/Qt6RemoteObjectsTargets.cmake
第94行
# Load information for each installed configuration.
get_filename_component(_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(GLOB CONFIG_FILES "${_DIR}/Qt6RemoteObjectsTargets-*.cmake")
foreach(f ${CONFIG_FILES})
include(${f})
endforeach()
这里模糊查找,所以也是为什么删掉也不报错。把里面内容写错,不知道为什么也不报错,暂时没理解。
经过再次验证,由于有cache,改错,从0开始,这里会报错。
CMake Error at 3P/QT/6.2.40/mac64_tls/lib/cmake/Qt6RemoteObjects/Qt6RemoteObjectsTargets-debug.cmake:10 (_properties):
Unknown CMake command "_properties".
Call Stack (most recent call first):
3P/QT/6.2.40/mac64_tls/lib/cmake/Qt6RemoteObjects/Qt6RemoteObjectsTargets.cmake:94 (include)
3P/QT/6.2.40/mac64_tls/lib/cmake/Qt6RemoteObjects/Qt6RemoteObjectsConfig.cmake:50 (include)
3P/QT/6.2.40/mac64_tls/lib/cmake/Qt6/Qt6Config.cmake:209 (find_package)
3P/build-central/cmake/3.23.1/MAC64/CMake.app/Contents/share/cmake-3.23/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)
3P/ClientFramework/0.1.24/MAC64-Debug-MAC64-universal-debug/lib/cmake/ClientData/ClientDataConfig.cmake:23 (find_dependency)
3P/ClientFramework/0.1.24/MAC64-Debug-MAC64-universal-debug/lib/cmake/ClientFramework/ClientFrameworkConfig.cmake:27 (find_package)
Core/Neutron/Build/Common/CMake/ClientFramework.cmake:21 (find_package)
Core/Neutron/Server/ToolProperties/CMakeLists.txt:41 (add_client_framework_dependencies_to_target)

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有