[CMake] install() question

Robert Dailey rcdailey at gmail.com
Fri Oct 14 13:57:50 EDT 2011


On Fri, Oct 14, 2011 at 11:22 AM, Hendrik Sattler
<post at hendrik-sattler.de>wrote:
>
> Yes. Compilation of a project should always be possible without polluting
> the system.
>
> For other programs or libraries in the same source tree, install() is not
> the right thing.
> You have several options:
> a)
> Copy the headers in the right structure to the build tree and use as
> include directory. This also makes your install() command easier: you just
> have to copy the directory as-is. However, you have to setup dependencies
> correctly so that changed header files (and only those) get copied again if
> they changed. If you build in-tree (source dir == build dir, which is not
> recommended), such a scheme may have problems.
>
> b)
> Is there _any_ reason to no arrange the headers in the source tree in a way
> that makes it usuable for direct inclusion?


I'm converting this very large code base to use CMake, it currently uses
Cygwin and makefiles. I can't rearrange anything yet until the whole company
merges over to CMake, since the Makefile build system depends on the current
hierarchy. For now CMake has to just work around issues like these by making
copies as you say and using the temp copies as the source directory.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111014/7ec269e4/attachment.htm>


More information about the CMake mailing list