[CMake] ADD_CUSTOM_COMMAND issues

Yegor Yefremov yegor_sub1 at visionsystems.de
Fri Jul 13 11:02:53 EDT 2007


Brandon Van Every schrieb:
> On 7/13/07, Brandon Van Every <bvanevery at gmail.com> wrote:
>
>>
>> I've noted the following weird behavior on the MinGW generator,
>> executing under a Windows 2000 command prompt.  I do not have ctags
>> installed on my system.  Running from a pristine out-of-source build
>> directory, the 1st time I execute "mingw32-make", I get errors as I
>> would expect.  The 2nd time, I don't.  Then if I do "mingw32-make
>> clean", followed by "mingw32-make", I get errors as I would expect.
>> Errors only get reported once per build.
>
> Or maybe this is expected POST_BUILD behavior?  The executable builds
> just fine.  Then a POST_BUILD event is run, and it does whatever.  The
> next time we try to build the executable, it's already built, so no
> POST_BUILD event is run.  If this is expected behavior, then it should
> be documented.  It's easy for a user to get confused and think a
> POST_BUILD should behave as a simple dependency.  The docs merely say,
> "POST_BUILD - run after the target has been built."
>
> Cheers,
> Brandon Van Every
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
[citation from http://www.cmake.org/HTML/Documentation.html]:

When the command will happen is determined by which of the following is
specified:

  PRE_BUILD - run before all other dependencies
  PRE_LINK - run after other dependencies
  POST_BUILD - run after the target has been built

It is only said when the command will happen and not where to place
the statement in the CMakeLists.txt. I interpret this as if I define
PRE_LINK or PRE_BUILD then the cmake will evaluate this properly.
It should be also mentioned in the documentation or CMake should throw 
warning.

Cheers,
Yegor Yefremov





More information about the CMake mailing list