[CMake] Creating a common (= across several projects) CMake module/include-file/library
Shlomi Fish
shlomif at shlomifish.org
Tue May 14 13:48:54 EDT 2013
Hi Jean-Christophe,
On Mon, 13 May 2013 18:27:03 -0400
Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com> wrote:
> Hi,
>
> To download the common file(s) at configure time, you could follow the
> approach discussed here:
> http://cmake.3232098.n2.nabble.com/is-it-possible-to-download-CMake-modules-at-configure-time-td7583968.html#a7584113
>
I see, but it's hard to see what to do based on this git commit:
https://github.com/commontk/CTK/compare/00694c9f8a0da6ee28fb079902e6a8c3ec428058...891aa5443b110cc7e6aa0ec1339aad4b2c83ef9d
Regards,
Shlomi Fish
> Hth
> Jc
>
>
> On Mon, May 13, 2013 at 6:17 PM, Matthew Woehlke <
> matthew.woehlke at kitware.com> wrote:
>
> > On 2013-05-11 17:22, Shlomi Fish wrote:
> >
> >> many of my CMake-based projects carry a common top-level "Common.cmake"
> >> file
> >> that I copy from one project to another and enhance, and since this is
> >> duplicate code/functionality I would like to consolidate it.
> >>
> >> What I want to be able to do is say something like:
> >>
> >> <CODE>
> >> INCLUDE(ShlomifCommon)
> >> </CODE>
> >>
> >> at the top, and then have it read from a system wide "ShlomifCommon.cmake"
> >> file that I will maintain in one central location, and install.
> >>
> >
> > If you put the file in one of CMake's default module search paths, it
> > should Just Work. And/or if you arrange for your software process to set
> > CMAKE_MODULE_PATH to the location of the same, then again it should Just
> > Work.
> >
> > For redistribution, I would have your project do a list(APPEND) on the
> > same to where the file will exist when building from a distribution source
> > package. In development, just don't have a copy in that location (or you
> > could put one there to override the system copy if for some reason you need
> > to do so).
> >
> > Another option to consider is keeping the file in an external repository
> > and using your VCS's external-repo support to bring it into your other
> > projects. This way the file exists in your source tree, but your VCS is
> > tracking it against a central repository, rather than each project's repo
> > having independent copies. (This will also probably make getting the file
> > into your source packages easier.)
> >
> >
> > For a bonus point, I'd like to have a way to copy this file into
> >> every project's tarball so it won't require installation.
> >>
> >
> > How do you create tarballs?
> >
> > --
> > Matthew
> >
> >
> > --
> >
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at http://www.kitware.com/**
> > opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
> >
>
>
>
--
-----------------------------------------------------------------
Shlomi Fish http://www.shlomifish.org/
List of Text Processing Tools - http://shlom.in/text-proc
http://en.wikipedia.org/wiki/Evil redirects to XSLT.
— http://www.shlomifish.org/humour/bits/facts/XSLT/
Please reply to list if it's a mailing list post - http://shlom.in/reply .
More information about the CMake
mailing list