将cmake与eclipse集成时缺少Source和include文件夹 [英] Missing Source and include folder when integrating cmake with eclipse

查看:128
本文介绍了将cmake与eclipse集成时缺少Source和include文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是CMake的新手,我正在尝试将CMake与Eclipse集成。

I am new to CMake and I am trying Integrate CMake with Eclipse.

下面是我拥有的文件结构的示例。

Below is the example of the file structure that I have.

项目


  • build / linux

  • build / linux / Release(应包含发布库和文件)

  • build / linux / Debug(应包含文件的调试版本)

  • build/linux
  • build/linux/Release (Should contain the release libraries and files)
  • build/linux/Debug (Should contain the debug version of the files)

SRC


  1. subProject_1

    .cpp(所有源文件)和此文件夹的CMakeLists.txt 1(创建静态库)

  2. subproject_2

    .cpp(所有源文件)和CMakeLists.txt 2与此文件夹(

  3. subproject_3

    .cpp(所有源文件)和此文件夹的CMakeLists.txt 3(创建可执行文件)


  • 包含

  • Include


    1. subProject_1

      .h(所有头文件)

    2. subProject_2

      .h(所有头文件)

    3. subProject_3

      .h(所有头文件)


  • 可以吗请让我知道我将如何诠释将CMake升级到Eclipse。我想在Source中进行构建,以便可以对代码进行子版本化。

    Can you please let me know how would I be able to integrate CMake to Eclipse. I would like to do a in Source build so that I can sub version my code.

    我尝试了将主CMakelist放在项目文件夹,project / build / linux文件夹等中的其他选项。我可以使项目正常运行,但看不到Eclipse上的源文件夹和包含文件夹。

    I have tried different options of placing the main CMakelist in project folder, project/build/linux folder and so on. I can get the project working but I dont get to see the source folder as well as the include folder on eclipse.

    我尝试了 http://www.vtk.org/Wiki/CMake:Eclipse_UNIX_Tutorial#CMake_with_Eclipse

    推荐答案

    通常很简单:从一个干净的构建目录,使用Eclipse作为生成器配置cmake(如果使用cmake-gui会更容易),然后导入构建目录进入Eclipse(文件,导入,常规,现有项目进入工作区)。

    It's usually very simple: from a clean build directory, you configure cmake using Eclipse as generator (it's easier if you use cmake-gui), and then you import the build directory into Eclipse (File, Import, General, Existing Projects into Workspace).

    这篇关于将cmake与eclipse集成时缺少Source和include文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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