[CMake] cmake 2.6.0 - eclipse CDT - lib project

Miguel A. Figueroa-Villanueva miguelf at ieee.org
Mon Jun 9 20:26:49 EDT 2008


On Fri, Jun 6, 2008 at 6:14 PM, Olivier Tournaire wrote:
> Hi all,
>
> I am currently tring to import a cmake generated project in eclipse. This
> project is a lib, and eclipse does not seem to be able to load it.
> Everything works fine when importing an executable project
> (File>Import>General>Existing project>End). When importing my lib project,
> The "end" button in unavailable. Is it a known problem or am I doing
> something wrong ?

Hello Olivier,

I'm the author of the cmake eclipse generator, although I have to
admit I have never tested this case... If you make it work manually
and send me the .project/.cproject I can work with you to add this
support to the generator.

> Another question : how to set in CMakeLists.txt an option to build on N
> cores ? That is to say the equivalent of the -j option (which is now also
> supported by MSVC, from 2005 version) ?

I'll let someone else help with this. This has nothing to do with the
eclipse generator since it is an extended generator based on the
makefiles one. Hence, if it works for the makefile generator it should
work in eclipse.

> Last one : is it possible to create a CMakeLists.txt which handles a Debug
> and a Release configuration in the same project in eclipse ?

The usual way to do this as far as I know is that you create a build
directory for each:

workspace
|_source
|_debug_build
|_release_build

Then, you can do the following and import the two resulting projects:

cd debug_build
cmake -DCMAKE_BUILD_TYPE:STRING=Debug ../source
cd release_build
cmake -DCMAKE_BUILD_TYPE:STRING=Release ../source

Hope this helps.

--Miguel


More information about the CMake mailing list