[CMake] Parallel builds and Eclipse CDT4 generator

Adolfo Rodríguez dofo79 at gmail.com
Fri Mar 13 04:31:37 EDT 2009


On Thu, Mar 12, 2009 at 10:56 PM, Alexander Neundorf <
a.neundorf-work at gmx.net> wrote:

> On Thursday 12 March 2009, Bill Hoffman wrote:
> > Alexander Neundorf wrote:
> > >> I'm using CMake 2.6.2 and Eclipse CDT5 (not CDT4, could this be an
> > >> issue?)
> > >
> > > I don't think so.
> > > We could add some special variable, like
> > > CMAKE_MAKEFILE_PROJECT_FLAGS or CMAKE_MAKEFILE_PARALLELITY, and use
> this
> > > in the makefile-based generators to set the "-jx" parameter for make.
> But
> > > then again, this shouldn't be hardcoded in the CMakeLists.txt, so it
> > > could only be a cache variable.
> > > Or should cmake try to determine automatically how many cores there are
> > > and add "-jx" automatically ? E.g. using sysconf(_SC_NPROCESSORS_ONLN)
> ?
> > > This could also be disabled by default and enabled e.g. via an option
> > > like CMAKE_AUTOMATIC_PARALLEL_MAKE_INVOCATION or something like this.
> >
> > This sounds like an Eclipse issue...  Does this work:
> >
> > http://dev.eclipse.org/newslists/news.eclipse.tools.cdt/msg15742.html
>
> From that link:
>
> > project properties -> C/C++ Build -> Behaviour tab
>
> I can't find this here.
> I have Project -> Properties -> C/C++ Make project
> and then there is nothing with parallel builds.
>
> Can you see that option ?


I have compared two Eclipse projects, one generated manually using custom
Makefiles, and another one genereated by CMake with the "Eclipse CDT4 - Unix
Makefiles" generator.
Effectively, the former _has_ the *project properties -> C/C++ Build ->
Behaviour *tab, but the CMake project does _not_. Could this be related to
the way CMake creates an Eclipse project? I used CDT5 and not 4, could it be
version related?

As Alex points out, the closest thing that is available is *Project ->
Properties -> C/C++ Make project*. There, in the Make Builder tab you can
set the Build command and add the -j# option. This is a per-project setting
and will only work if you build your project by doing *Project->Build
Project* or *Project->Build All*. It turns out that I had played with this
parameter before, and didn't seem to work because I was invoking directly
the individual targets (all, foo) from the Make Targets tab of the C/C++
perspective (and these targets have separate build settings).

As I'm quite ignorant on all things Eclipse, could it be possible to use the
Build Command specified in *Project -> Properties -> C/C++ Make project* for
each individual target? so that if it changes, this change will be
propagated. Right now I'm under the impression that they are decoupled.

Thanks,

Adolfo

P.S. The current workaround seems a good-enough solution for now.

>
> Alex
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/listinfo/cmake
>



-- 
Adolfo Rodríguez Tsouroukdissian

Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090313/27f2b522/attachment.htm>


More information about the CMake mailing list