[CMake] install(DIRECTORY . DESTINATION include/proj FILES_MATCHINGPATTERN "*.h")

David Cole david.cole at kitware.com
Wed Oct 28 13:18:55 EDT 2009


On Wed, Oct 28, 2009 at 11:45 AM, Mathieu Malaterre <
mathieu.malaterre at gmail.com> wrote:

> On Wed, Oct 28, 2009 at 4:41 PM, Tyler Roscoe <tyler at cryptio.net> wrote:
> > This is a bad practice because then CMake has no way to know if there
> > are new header files and can't regenerate/install correctly. Ok maybe a
> > new header coming in will happen to trigger a rerun of CMake because the
> > header happens to belong to one of your built libraries or executables,
> > but I think this solution is more dangerous than just excluding .svn
> > explicitly.
>
> +1
>
> Indeed I did not realize that.
>

Except: that argument is not valid in this case. Neither file(GLOB nor
install(DIRECTORY will "rerun" anything if a new header file is added into
the directory...

File(GLOB is discouraged for specifying source files to add_library and
add_executable because of the "cmake won't rerun if you add a file" problem.
But in this case... it's 6 of one half dozen of the other -- neither case
will detect the addition of a header file to the system....
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20091028/41807287/attachment.htm>


More information about the CMake mailing list