[CMake] change source which does not trigger rebuild ?

Martin Koller martin.koller at etm.at
Wed Mar 13 09:22:33 EDT 2013


I'd like to solve the following problem, but have not found a way how to yet:

Our source is rebuilt every night, but only if some sources changed (e.g.
the build tree is not removed, only the source tree is updated from CVS).

What I want is to include the build date/time in a versionInfo.cxx sourcefile
(with __DATE__ and __TIME__ macros) if and only if the executable needs a rebuild.
That is, the executable has a commandline option "-version" which should print
the information "build time: xxxxx"

So what I need is something like a rule:
"if the exe needs a rebuild (any dependant source changed except the versionInfo.cxx file),
rebuild the versionInfo.o file and link it to the executable"

Any ideas ?

-- 
Best Regards/Schöne Grüße

Martin

-----------------------------------------------------------------
Ing. Martin Koller , mailto:martin.koller at etm.at , http://www.etm.at
ETM professional control GmbH, A-7000 Eisenstadt Marktstr. 3
Phone:+43 2682/741-62603, Fax:+43 2682/741-52555
-----------------------------------------------------------------
A: Because it breaks the logical sequence of discussion
Q: Why is top posting bad?




More information about the CMake mailing list