为何使用Cmake与eclipse

时间:2016-01-07 10:40:07

标签: c++ eclipse cmake

我正在为我最初构建的库添加功能, cmake-> make-> make install。

但是,在添加功能(新的.cpp和.h文件)时,教程使用eclipse来构建项目,

cmake -G“Eclipse CDT4 - Unix Makefiles” 并在Eclipse中构建项目。

使用Eclipse构建项目的目的是什么,是否可以在不使用eclipse的情况下构建?

2 个答案:

答案 0 :(得分:1)

这将从Cmakefiles重新生成eclipse项目配置,以包含您添加的新文件。如果你没有使用eclipse进行开发,根本不需要这样做,你可以使用标准的makefile。

你甚至不需要再次使用cmake,只需要make rebuild_cache;使; make install应该可以正常工作。

答案 1 :(得分:1)

没有特定原因需要Eclipse。如果只需要makefile,则可以执行以下操作:

               <div class="slider-wrapper">
                    <div class="fotorama" data-nav="thumbs" data-auto="false" data-allowfullscreen="true">
                        {% for photo in page.gallery.galleryHasMedias %}
                            <img src="{% path photo.media, "medium" %}">
                        {% endfor %}
                    </div>
                    <div class="nav-count" style="text-align: center">
                        <span style="display: inline-block">
                            <span class="activeIndex">1</span>
                            <span>/{{ page.gallery.galleryHasMedias | length }}</span>
                        </span>
                    </div>
                </div>

要查看所有其他选项,请执行以下操作:

cmake -G"Unix Makefiles"