将 KDevelop 项目复制到另一个目录
将现有 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
项目文件与项目相关,因此包含许多绝对路径等。将源文件再次导入为新项目最容易。
我正在使用 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.
我刚刚遇到了同样的问题。对相关问题的答案使我采用了以下方法:
可以保留(并置于版本控制之下)项目顶层目录中的文件
<项目名称>.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) whilekdevelop
has not loaded the project.The project can now easily be reopened by
kdevelop
usingProject
->Open / Import
. After pointingkdevelop
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 closingkdevelop
.