[英]Setting up my source, build directories and make tool
I am trying to set up a new C++ project. 我正在尝试建立一个新的C ++项目。 I am trying to achieve the following:
我正在努力实现以下目标:
This seems like the setup I have seen in every tech company I have worked for. 这似乎是我在曾经工作过的每家科技公司中看到的设置。 I don't know enough about make tools though to do this.
我对制作工具还不甚了解。 Can I use cmake to achieve the above?
我可以使用cmake实现以上目标吗? Many thanks in advance.
提前谢谢了。
Can I use cmake to achieve the above?
我可以使用cmake实现以上目标吗?
yes: 是:
CMakeLists.txt
is in ~/repo/source/
, you run either cmake ../source
from ~/repo/build/
(or absolute path) dir or use the gui with that path. CMakeLists.txt
位于~/repo/source/
,则可以从~/repo/build/
(或绝对路径)dir运行cmake ../source
或将gui与该路径一起使用。 But normaly the build
is placed within your project ( ~/repo/source/build
) and eg. build
会放置在您的项目( ~/repo/source/build
)中,例如。 added to git ignore since it's not designated for sharing. cmake ..
from there. cmake ..
build
dir (see #2); build
目录中(请参阅#2); add this to .gitignore
. .gitignore
。 For sharing your project: just don't share build
. build
。 CMakeLists.txt
is. CMakeLists.txt
所在的路径运行cmake。 But: child-dirs can have their own lists.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.