如何在使用 cmake --install 时只复制特定文件?

问题描述 投票:0回答:1

每当我编辑

qt
源中的任何文件并重新编译时,我需要调用
cmake --install .
使其将更新的文件从源目录复制到目标目录,如:

它花费大量时间遍历检查未更新的数千个文件:

-- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_formeditorcommand_p.h
-- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_formwindowcommand_p.h
-- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_formwindowmanager_p.h
-- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_introspection_p.h
-- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_membersheet_p.h
-- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_menu_p.h
-- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_menubar_p.h
-- Up-to-date: D:/Qt/Debug/include/QtDesigner/6.4.0/QtDesigner/private/qdesigner_propertycommand_p.h
...

我如何直接指定它应该复制什么文件?

例如,只复制

Qt6Widgetsd.dll
?

我试过:

D:\Qt\qt-everywhere-src-6.4.0>cmake --install qtbase\bin\Qt6Widgetsd.dll
CMake Error: Error processing file: D:/Qt/qt-everywhere-src-6.4.0/qtbase/bin/Qt6Widgetsd.dll/cmake_install.cmake
c++ qt cmake
1个回答
0
投票

据我所知,您可以安装作为项目配置的一部分配置的特定组件(请参阅

component
install()
参数和--component
cmake --install
 参数),以及仅作为 
cmake --install
的一部分安装特定文件的唯一方法是将该文件配置为其自身安装组件的一部分,并仅指定该组件作为安装命令行调用的一部分进行安装。

© www.soinside.com 2019 - 2024. All rights reserved.