[CMake] Is it possible to obtain the exact cmake command line used to invoke cmake from within cmake?

Alexander Neundorf a.neundorf-work at gmx.net
Sun Oct 28 15:55:49 EDT 2007


On Sunday 28 October 2007, Eric Noulard wrote:
> 2007/10/27, Alan W. Irwin <irwin at beluga.phys.uvic.ca>:
> > As I respond to issues with the PLplot CMake-based build system that are
> > reported by our users, I repeatedly find myself asking them to report the
> > exact cmake command line that they used as well as full output from the
> > cmake command.  If from within cmake we could print out a string
> > corresponding to the exact cmake command line, then that simplifies my
> > request to them for a full bug report.
> >
> > Is it possible to obtain the exact command line used to invoke cmake
> > from within cmake?
>
> I don't know if it's already possible or not but I would be very interested
> in the feature too. Helping user to use the build system is of
> great interest.
>
> I think I would be useful to have the exact CMake command line
>
> 1) as a comment inside CMakeCache.txt
> 2) as a CMake string var something like:
>     CMAKE_COMMAND_LINE
>
> Note that may be  CMAKE_COMMAND_LINE should indicate
> what CMake tool was used: cmake, CMakeSetup, ccmake etc...
>
> Should on of us file a feature request?

Not sure how much this would help.

If you use ccmake, you don't need to specify arguments at all. You can later 
on run cmake or ccmake again and change variables (using ccmake or -D), 
actually several runs may be required.

So the initial command line doesn't have to contain everything you might want 
to know. I guess looking at the cache makes more sense.

Alex


More information about the CMake mailing list