[cmake-developers] dry-run support

Eric Noulard eric.noulard at gmail.com
Wed Jul 1 05:14:05 EDT 2015


2015-07-01 10:34 GMT+02:00 Honggyu Kim <hong.gyu.kim at lge.com>:

> Hi all,
>
> I would like to see the exact command execution list when I build using
> cmake.
> Make has an option "--dry-run" as many of you already know:
>
> $ make --help
> -n, --just-print, --dry-run, --recon
>                               Don't actually run any commands; just print
> them.
>
> Can anyone please let me know if there's a way to do dry-run in cmake.
> I appreciate all your comments.
>

There is one big noticeable difference between make and cmake.
CMake does not "build" software it creates build system that will be used
to build.

So dry-running CMake will not give you "exact command execution for
building".
The other main difference is that CMake has control statements-(option,
find_package, if-else, ...)
so that action/command executed during CMake run may heavily depend on the
**effective execution** (e.g. find_package) of a previous line of  the
CMake script.

So I my idea is that "dry-run" is not as useful for CMake as it is for make
(or ninja -n or other
build tool dry run mode).

What you already have with CMake is the --trace option which can be very
useful
to understand what happen at CMake time.

Then it may also be useful to dry-run the resulting build files produced by
CMake.
i.e.:

make --dry-run
ninja -n -v
...

-- 
Eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150701/bd4588d3/attachment.html>


More information about the cmake-developers mailing list