[CMake] Re-executing the make command with few or no source tree changes is extremely inefficient for CMake-2.4.3

Brad King brad.king at kitware.com
Thu Aug 17 13:53:01 EDT 2006


Alan W. Irwin wrote:
> I am running into a dependency issue with CMake 2.4.3 on Linux.  I find
> if I run cmake in an initially empty build directory followed by make, then all
> is well, i.e., everything builds without problems.  But if I change nothing
> in the source tree and run make again, the result surprised me by taking
> almost as long to complete as the first make.
[snip]
> add_custom_target(
> plhershey-unicode.h

Read the documentation of add_custom_target.  The first sentence says

  Adds a target with the given name that executes the given commands
  every time the target is built.

You need to use ADD_CUSTOM_COMMAND.

-Brad


More information about the CMake mailing list