[CMake] What is the preferred method of establishing the dependence of a custom command on an executable target?

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sun Apr 8 20:15:05 EDT 2007


On 2007-04-08 15:26-0700 Brandon J. Van Every wrote:

> Alan W. Irwin wrote:
>> 
>>           t             f
>> library =====> target =====> command
>>                      \
>>                       \ t
>>                         ===> executable
>> 
>> This new arrangement bypasses the whole issue of having a custom command
>> file depend on an executable
>
> Are you using GET_TARGET_PROPERTY to extract the location of the generated 
> .exe?  This is necessary for cross-platform use, i.e. MSVC will have Debug 
> and Release directories getting in the way.

No.

So that sounds like the source of the problem on one windows platform (but
not others) with the current "linear" chain of target and file dependencies.
Thanks for that insight.

What do you think of the possibility of using the above "forked" arrangement
of dependencies instead?  I will go to that (and not worry about
GET_TARGET_PROPERTY), if anybody can assure me that the executable will
always be built first before the custom command that requires it.

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list