将 KDevelop 项目复制到另一个目录

发布于 2024-08-29 00:20:03 字数 373 浏览 8 评论 0原文

将现有 KDevelop 项目文件夹复制到另一个目录的最佳方法是什么,以便新项目包含所有正确的目录设置和配置,并且尽可能少地进行手动编辑(从而减少出错的空间)?

这里有一些关于某人成功的信息,有关复制项目,然后编辑对旧路径的每个引用,但这正是我希望避免的。

事实上,Kdevelop 手册特别建议不要这样做(请参阅手册,第 8 章,“Project Hacking”[会发布一个链接,但我现在很疲倦])。

该项目在 SCM 上共享,并且应尽可能减少对特定用户的依赖。

What is the best way to copy an existing KDevelop project folder to another directory, so that the new project contains all the correct directory settings and configuration and there is as little manual editing (and thus less room for error) as possible?

There is some information about someone being successful here about copying the project and then editing every reference to the old path, but this is exactly what I'm hoping to avoid.

In fact, the Kdevelop manual specifically recommends against doing this (see manual, chapter 8, "Project Hacking" [would post a link but I'm nerfed for now]).

This project is shared on an SCM and should have as little dependency on a particular user as possible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

风追烟花雨 2024-09-05 00:20:03

项目文件与项目相关,因此包含许多绝对路径等。将源文件再次导入为新项目最容易。

我正在使用 CMake,这意味着我只需要重置构建路径和安装前缀。有时需要添加环境变量,但这只是复制+粘贴。

Project-files are project-related and therefore contain a lot of absolute paths etc. Its mostly easier to just import the sources again as a new project.

I'm using CMake which means that I just need to reset build-paths and the install-prefix. Sometimes environment variables needs to be added but thats just copy+paste.

二手情话 2024-09-05 00:20:03

我刚刚遇到了同样的问题。对相关问题的答案使我采用了以下方法:

  • 可以保留(并置于版本控制之下)项目顶层目录中的文件<项目名称>.kdev4。 (至少在我的情况下,它不包含任何绝对路径。)

  • 复制后应删除项目顶层目录中的隐藏目录.kdev4/(并从版本中排除)控制),而kdevelop尚未加载项目。

  • 现在可以通过 kdevelop 使用 Project 轻松重新打开该项目 -> 打开/导入。将kdevelop指向项目的顶级目录后,文件<项目名称>.kdev4被识别并可以接受。 kdevelop 然后询问缺少的选项。

该解决方案应该是干净的,并且在继续处理另一个目录中的项目时产生的开销最小。就我而言,当重新打开 cmake 项目时,我可以简单地接受建议的默认值。关闭 kdevelop 时会重新创建隐藏目录 .kdev4/

I just had the same problem. An answer to a related question brought me to the following approach:

  • One can keep (and put under version control) the file <project name>.kdev4 in the top directory of the project. (At least in my case, it doesn't contain any absolute paths.)

  • The hidden directory .kdev4/ in the top directory of the project should be deleted after copying (and excluded from version control) while kdevelop has not loaded the project.

  • The project can now easily be reopened by kdevelop using Project -> Open / Import. After pointing kdevelop to the top directory of the project, the file <project name>.kdev4 is recognized and can be accepted. kdevelop then asks for the missing options.

This solution should be clean and cause minimal overhead when continuing work on a project in another directory. In my case, when reopening a cmake project, I could simply accept the proposed defaults. The hidden directory .kdev4/ is recreated when closing kdevelop.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文