[CMake] installing generated files

Brandon Van Every bvanevery at gmail.com
Wed Nov 28 12:12:51 EST 2007


On Nov 28, 2007 6:45 AM, Stefan Kögl <skoegl at online.de> wrote:
> Am Mittwoch, 28. November 2007 10:38:20 schrieb Brandon Van Every:
> > You need to know the names of the files that will be generated and
> > then INSTALL(FILES ...)
> > Typically I just have a hardwired list of root words, from which I
> > derive .cxx .hxx and whatever a doxygen suffix is.  Here are some
> > helper routines.  You're probably also going to want an
> > ADD_CUSTOM_COMMAND so you can specify file outputs, rather than having
> > to always run doxygen.
> >
>
> This is really cumbersomely. Then I have to know how doxygen determines the
> output file names, and update the "root list" by hand every time I create,
> rename, and remove a file or function.
>
> ADD_CUSTOM_TARGET(docs-doxygen ALL
>     COMMAND ${DOXYGEN_EXECUTABLE} ${doxygen_BINARY_DIR}/Doxyfile
>     DEPENDS ${doxygen_BINARY_DIR}/Doxyfile
>     VERBATIM)

So now you're running this target every single time you build.  Which
is why I told you to use ADD_CUSTOM_COMMAND, so there would actually
be some file dependencies, so you wouldn't have to build it every
time.

> INSTALL(CODE "
>     FILE(GLOB DOXYGEN_OUTPUT ${doxygen_BINARY_DIR}/html/*)
>     FILE(INSTALL DESTINATION ${PERTUBIS_DOC_PATH}/html TYPE FILE FILES
> \${DOXYGEN_OUTPUT})
>     ")
>
> ##################################
>
> The "FILE(INSTALL ...." signature is still undocumented, but it works. Is this
> solution "future-proof"?

The INSTALL(FILES ...) signature is plenty documented in CMake 2.4.7,
and I think in some earlier 2.4.* also.

If there's such a thing as a public FILE(INSTALL ...) command, it is
not documented in CMake CVS.  At first brush, I would think having
INSTALL(FILES ...) and FILE(INSTALL ...) would be a poor choice for a
public API.


Cheers,
Brandon Van Every


More information about the CMake mailing list