[CMake] How to generate a source file with unpredictable dependency

Alexander Neundorf a.neundorf-work at gmx.net
Tue May 13 17:33:19 EDT 2008


On Tuesday 13 May 2008, Alexander Neundorf wrote:
> On Tuesday 13 May 2008, jlh wrote:
...
> > Since version.cpp is now a target, running "make version.cpp" does
> > what it's supposed to.  While working as a target, it fails to
> > work as a dependency.
> >
> > So how would I make this work?  I'm using cmake 2.4.8 on linux.
>
> ADD_CUSTOM_TARGET(make_version_target
> ${CMAKE_CURRENT_SOURCE_DIR}/makeversion COMMENT "Checking version.cpp"
> VERBATIM)
>
You can skip the following line:
> SET_SOURCE_FILES_PROPERTIES(version.cpp PROPERTIES GENERATED TRUE)


Alex


More information about the CMake mailing list