[CMake] Separate object directories on Linux?
Hendrik Sattler
post at hendrik-sattler.de
Wed Apr 2 17:22:49 EDT 2008
Am Mittwoch 02 April 2008 schrieb Bill Hoffman:
> Bryan O'Sullivan wrote:
> > On Windows and OS X, I notice that object files get put into a directory
> > prefixed with the current build type, e.g. Debug or Release. This
> > doesn't happen on Linux, so I can't have a single build tree with
> > multiple builds side by side in it. Is there some reason for this? The
> > variation in behaviour across platforms seems peculiar.
>
> Basically, this is because on windows we use the default for the native
> tool visual studio which supports configuration types. On makefile
> builds we only support a single configuration per build tree as would be
> expected in a most makefiles. I guess it is the price we pay for
> generating to native build tools, there are sometimes inconsistencies.
> It would be nice if at some point in the future we supported
> configurations for makefiles, and flat builds for ide's, but this has
> not yet been done.
The context menu of current Eclipse projects contain a greyed-out build types
menu. Is this something similar and why is it not used with cmake-generated
project files?
Additionally, the WIKI entry for Eclipse CDT support suggest an extra variable
(with a way toooooooo long name) to create the .project file in the source
tree. However:
- the WIKI mentions an invalid command line:
cmake -G"Eclipse CDT4 - Unix Makefiles" \
-DECLIPSE_CDT4_GENERATE_SOURCE_PROJECT ../certi_src
A :BOOL=TRUE is missing here.
- the eclipse project is totally useless without that option as the project
are about editing the source, not just triggering the build from a GUI :-/
Why aren't there options for generators? They could ask about the Makefile
type and about creating that .project file in the source dir. The current way
is really hard to sell to users. The above command line should be:
$ cmake -GEclipse ../certi_src
The CDT4 is irrelevant and even hurts if JDT support for Java is ever added.
It is also irrelevant that it uses Makefiles because that may also change?!
And if no make is available but nmake, why does the user actually have to
specify that? On Linux, you don't even have a choice and this makes the name
even more questionable.
Since Makefiles are _very_ often used for generators, can't those be merged
into _one_ option for -G (with autodetection of present make variants) and
adding another option that allow manually choosing one? Again a perfect fit
for cmake-gui asking the user when needed:
[in a cmake GUI]
click configure
-> a dialog pops up asking for the generator
choose "Eclipse"
-> a 2nd dialog ask for Eclipse project options eventually checking that the
build directory fits the restrictions
choose a Makefile project
-> since several makes are available, a 3rd dialog pops up with a choice
between "nmake" "MSYS make" and "Unix make", maybe even with a help button
explaining what "Unix make" actually means on Windows.
That would improve usability of the cmake GUIs a _lot_.
The WIKI Eclipse entry is also hard to understand: in "Accessing the Source
and Advanced Editing Features", it is not clear wether the extra definition
is needed or not. It is missing a conclusion like: do it that way and you'll
can do anything in Eclipse like normal.
BTW: installing VisualStudio Express 2008 from the downloadable DVD image
doesn't seem to be enough: cmake does not find an RC compiler although "rc"
is present and in PATH. Anyone actually tested that?
Conclusion: cmake on Windows is still pretty hard to use. Much nicer on Linux.
HS
More information about the CMake
mailing list