如何使用cmake在指定的构建目录中生成Visual Studio
我有cmake 2.8.2。和一个具有如下目录的项目:在存储库中,我有 bin 目录来存储构建的二进制文件。我可以在 bin
文件夹中生成 Visual Studio 解决方案文件,而使用 cmake-gui
不会出现任何问题。但我想使用命令行版本的 cmake 生成解决方案文件。
我在 bin
目录中尝试了 cmake -G "Visual Studio 9 2008" ..
,但解决方案文件是在存储库目录中生成的。
I have cmake 2.8.2. and a project with directory like this: In the repository, I have bin
directory to store built binary files. I can generate visual studio solution files in bin
folder without any problem with cmake-gui
. But I'd like to generate solution file using the command line version of cmake.
I tried cmake -G "Visual Studio 9 2008" ..
in bin
directory, but solution file is generated in the repository directory.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
一般情况下,只需运行
cmake -G“Visual Studio 9 2008”..
而在你的 bin 目录中应该可以工作。
但是,如果仍然存在早期“源内”构建中的 CMakeCache.txt 文件,则此操作将不起作用。 ..目录下有CMakeCache.txt吗?是这样吗,删除后重试...
Under normal circumstances, simply running
cmake -G"Visual Studio 9 2008" ..
while in your bin directory should work.
However, if there is still a CMakeCache.txt file from earlier "in-source" build, this will not work. Is there a CMakeCache.txt in the .. directory? Is so, remove it and try again...
假设您已经
在存储库中创建了一个 bin 目录:
然后您可以执行您想要的操作:
并且它将起作用。
lets say you have
and you create a bin directory in Repository:
then you can do what you want:
and it will work.