[CMake] Automatic management of Eclipse projects

Alexander Neundorf a.neundorf-work at gmx.net
Mon Jun 22 14:52:44 EDT 2015


On Monday, June 22, 2015 18:02:01 Cedric Doucet wrote:
> Hello,
> 
> I am testing the possibility of generating Eclipse projects with CMake.
> I use the following command line:
> cmake -G"Eclipse CDT4 - Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ../src
> It works fine.
> 
> However, I would like to go further in this direction.
> - What could I put in CMakeLists.txt to not to have to pass the "-G" option
> to cmake? 

Currently you have have to use -G, or use cmake-gui.
Support for a cmake-specific environmnent variable like 
CMAKE_DEFAULT_GENERATOR could be added.

> - How could I be able to switch between debug and release modes
> in Eclipse?

Generate two build trees (projects), and import them both in cmake.

Alex



More information about the CMake mailing list