C++构建自定义定义

发布于 2024-09-30 09:35:02 字数 332 浏览 1 评论 0原文

之类的东西时,如何将自定义命令添加到 cmake

当调用诸如cmake -G"Visual Studio 9 2008"

我希望能够在提供的库查找器时处理这种情况/ 配置器工作错误,我想覆盖相应的变量,例如

set BOOST_DIRECTORY = C:\boobs\

来解决找不到boost库之类的问题。

我希望我能找到我自己也用了相应的方式,但我不能。

谢谢。

How can I add custom commands to the cmake when invoking something like

cmake -G"Visual Studio 9 2008"

I wish to be able to handle the case when the supplied library finder / configurator works wrong and I want to override the corresponding variables like

set BOOST_DIRECTORY = C:\boobs\

to solve problems like no boost libraries wer found.

I wish I could have found the corresponding way myself, but I couldn't.

Thanks.

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

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

发布评论

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

评论(2

初雪 2024-10-07 09:35:02

要在命令行上传递变量,请使用 -D 开关,例如:

cmake -G"Visual Studio 9 2008" -DBOOST_DIRECTORY="PATH"

To pass variables on the command line use the -D switch like:

cmake -G"Visual Studio 9 2008" -DBOOST_DIRECTORY="PATH"

淡淡绿茶香 2024-10-07 09:35:02

您可以使用 CMake gui 程序以交互方式设置缓存值:

ccmake

或:

cmake-gui

You can use the CMake gui programs to interactively set Cache values:

ccmake

or alternatively:

cmake-gui

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