简体   繁体   English

使用cmake构建时,qtcreator忽略cmake选项

[英]qtcreator ignores cmake options when building with cmake

I am currently opening my project in qtcreator by simply opening the CMakeLists.txt file associated with my project. 我目前正在qtcreator中打开我的项目,只需打开与我的项目相关联的CMakeLists.txt文件。 This is working great as I can build, debug and run the project from qtcreator. 这很有效,因为我可以从qtcreator构建,调试和运行项目。 Now I am trying to run cmake with the argument -DPCL_DIR=/usr/local which changes the default path of the PCL library which I am using in my code. 现在我尝试使用参数-DPCL_DIR=/usr/local运行cmake,它改变了我在代码中使用的PCL库的默认路径。 I can do this fine from the command line. 我可以从命令行做到这一点。 However when trying to do it from qtcreator using the cmake wizard it ignores the -DPCL_DIR option and compiles using the default library location. 但是,当尝试使用cmake向导从qtcreator执行此操作时,它会忽略-DPCL_DIR选项并使用默认库位置进行编译。 How can I get qtcreator to not ignore the cmake argument?? 如何让qtcreator不要忽略cmake参数?

Alternatively I can run cmake from command line and somehow get qtcreator to point to the Makefile generated by the command line cmake run, but I don't know how to do that. 或者我可以从命令行运行cmake,并以某种方式让qtcreator指向由命令行cmake run生成的Makefile,但我不知道该怎么做。

A solution to any of the above problems is appreciated. 可以理解上述任何问题的解决方案。

Upgrading to qtcreator 2.8 solved the problem. 升级到qtcreator 2.8解决了这个问题。

One make shift solution I found that does not require an upgrade of qtcreator, is to simply run cmake -DPCL_DIR inside the qtcreator-build folder from terminal and then simply build from qtcreator without running cmake. 一个make shift解决方案我发现不需要升级qtcreator,只需从终端在qtcreator-build文件夹中运行cmake -DPCL_DIR ,然后只需从qtcreator构建而不运行cmake。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM