[CMake] custom target (kernel modules)
Alexandru Ciobanu
aciobanu at matrox.com
Fri Jun 29 09:29:37 EDT 2007
Hi, Clark!
Here is the reason why I wanted to use this approach.
I use ADD_CUSTOM_COMMAND and ADD_CUSTOM_TARGET because I don't want
to run that Makefile at all if the files did not change.
ADD_CUSTOM_TARGET with ALL parameter would always run make. And even if
there
are no modifications to the source files, you'll see something like this
on the screen:
[make] I've been in that dir
[make] nothing to do there
[make] all targets ok, leaving, I'm done, etc..
And this will appear every time you build.
I don't want that on my screen. It strains my eyes. I want a clean
output. =)
When combined, the above commands, always try to build the target, but
run make
only when needed -> no extra stuff on the screen (unless modifications
detected).
Alex Ciobanu
Clark J. Wang wrote:
> On 6/29/07, *Alan W. Irwin* <irwin at beluga.phys.uvic.ca
> <mailto:irwin at beluga.phys.uvic.ca>> wrote:
>
> On 2007-06-29 09:04+0800 Clark J. Wang wrote:
>
> > On 6/28/07, Alan W. Irwin <irwin at beluga.phys.uvic.ca
> <mailto:irwin at beluga.phys.uvic.ca>> wrote:
> >>
> >> On 2007-06-28 10:08-0400 Alexandru Ciobanu wrote:
> >> > If I use the ALL parameter in add_custom_target() it will
> always rebuild
> >> it,
> >> > even if none of source files has changes.
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>
> > Hi Alan, I have a question here. Why bother to call both
> ADD_CUSTOM_COMMAND
> > and ADD_CUSTOM_TARGET? It seems like only ADD_CUSTOM_TARGET with ALL
> > parameter is enough. Does your method have some advantage?
>
> See above quote from Alexandru. Also, if you read the
> ADD_CUSTOM_TARGET
> documentation, the reason why it always rebuilds is fully
> explained there.
>
> "The target has no output file and is ALWAYS CONSIDERED OUT OF
> DATE...."
>
>
> I see. Thank you so much.
>
> Alan
>
> __________________________
> Alan W. Irwin
>
> Astronomical research affiliation with Department of Physics and
> Astronomy,
> University of Victoria (astrowww.phys.uvic.ca
> <http://astrowww.phys.uvic.ca>).
>
> Programming affiliations with the FreeEOS equation-of-state
> implementation
> for stellar interiors (freeeos.sf.net <http://freeeos.sf.net>);
> PLplot scientific plotting software
> package (plplot.org <http://plplot.org>); the libLASi project (
> unifont.org/lasi <http://unifont.org/lasi>); the Loads of
> Linux Links project (loll.sf.net <http://loll.sf.net>); and the
> Linux Brochure Project
> (lbproject.sf.net <http://lbproject.sf.net>).
> __________________________
>
> Linux-powered Science
> __________________________
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list