如何配置Eclipse CDT for cmake? [英] How to configure Eclipse CDT for cmake?

查看:1885
本文介绍了如何配置Eclipse CDT for cmake?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用cmake插件CDT配置EclipseHelios?

  cmake all 
CMake错误:源目录D:/ javaworkspace / workspace / Planner / Debug / all不存在。

Eclipse总是想使用'all'选项,我不知道如何停止它用它。



我已经看到在构建行为部分中,在首选项中有全部选项。

解决方案

在Eclipse-CDT中,不要创建 cmake项目,但是导入cmake项目。
这是你应该做的:


  1. 说你的CMake项目名为planner的源代码位于 D:/ workspace / src / Planner


  2. 创建文件夹对方: D:/ javaworkspace / build / Planner


  3. javaworkspace / build / Planner,使用Eclipse生成器运行CMake:

      cmake ../../src/Planner -G Eclipse CDT4  -  Unix Makefiles

    这将为您的Planner项目生成make文件。

  4. / p>

    并选择 D:/ javaworkspace / build / Planner (具有make文件的构建输出文件夹)现有代码位置


但是,看看你的路径,在Windows中,CMake可以生成Visual Studio项目。如果你想使用CMake我建议首先使用CMake创建一个hello world项目(记住,Eclipse不创建CMake项目,你必须手动创建一个CMakeLists.txt文件)


How to configure Eclipse "Helios" with plugin CDT for cmake?

cmake all 
CMake Error: The source directory "D:/javaworkspace/workspace/Planner/Debug/all" does not    exist.

Eclipse always wants to use 'all' option and I don't know how to stop its to not use it.

I've seen that in "Build behavior" section, in "Preference" there have been 'all' option. I erased this, but it still works wrong (this same error).

解决方案

In Eclipse-CDT you do not create cmake projects but you import cmake projects. This is what you should do:

  1. Say the source of your CMake project named "planner" is located in D:/workspace/src/Planner

  2. Create a folder (the folders NEED to be parallel to each other): D:/javaworkspace/build/Planner

  3. Go to the folder D:/javaworkspace/build/Planner and run CMake using the Eclipse generator:

    cmake ../../src/Planner -G"Eclipse CDT4 - Unix Makefiles"
    

    This will generate the make files for your Planner project.

  4. To import this in Eclipse do the following:

    File -> Import -> Existing code as Makefile project

    and select D:/javaworkspace/build/Planner (the build output folder with the make files) as the "Existing Code location"

However, looking at your paths it seems to me that you are working on Windows. In windows CMake can generate Visual Studio projects. If you want to use CMake I suggest first creating a "hello world" project using CMake (remember, Eclipse does not create CMake projects, you have to create a CMakeLists.txt file by hand)

这篇关于如何配置Eclipse CDT for cmake?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆