在此页面

在 Windows 上使用连接点

Windows 上较长的项目路径可能导致构建失败。

要解决这些问题

  • 使用绝对路径较短的源代码目录名。例如,使用C:\dev 而不是C:\Users\My Name\Projects
  • 使用较短的编译目录路径。
  • 使用 CMake 的忍者生成器。
  • 在 Windows 上为源代码和构建目录使用交界点。

交界点

交界点,一个目录作为计算机上另一个目录的别名。

要在 CMake 配置、构建和安装操作中使用交界点,请访问Preferences >CMake >General 并选择Use junctions for CMake configuration and build operations

CMake 偏好设置中的常规选项卡

构建系统会通过交界点配置、编译和安装项目,从而缩短命令行命令。

设置环境变量

Qt Creator 连接点存储在C:\ProgramData\QtCreator\Links 中。要使用其他路径,可将其设置为QTC_CMAKE_JUNCTIONS_DIR 环境变量的值。

设置QTC_CMAKE_JUNCTIONS_HASH_LENGTH 环境变量可缩短 MD5 哈希密钥长度,默认值为 32。

另请参阅 如何使用 CMake 构建

Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.