Re: [CMake] Creating a common (= across several projects) CMake module/include-file/library

2013-06-27 Thread Alexander Dahl
Hei hei, 

On Mon, May 13, 2013 at 06:17:58PM -0400, Matthew Woehlke wrote:
> 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.)

We do this with git submodules and adding the path of this
subdirectory to the cmake paths like you described. Works pretty well.

Greets
Alex

-- 
»With the first link, the chain is forged. The first speech censured, 
the first thought forbidden, the first freedom denied, chains us all 
irrevocably.« (Jean-Luc Picard, quoting Judge Aaron Satie)
*** GnuPG-FP: 02C8 A590 7FE5 CA5F 3601  D1D5 8FBA 7744 CC87 10D0 ***


pgpS98arMlF2F.pgp
Description: PGP signature
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Creating a common (= across several projects) CMake module/include-file/library

2013-05-14 Thread Shlomi Fish
Hi Jean-Christophe,

On Mon, 13 May 2013 18:27:03 -0400
Jean-Christophe Fillion-Robin  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.woeh...@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:
> >>
> >> 
> >> INCLUDE(ShlomifCommon)
> >> 
> >>
> >> 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
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/**CMake_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > 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 .
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Creating a common (= across several projects) CMake module/include-file/library

2013-05-14 Thread Shlomi Fish
Hi Matthew,

On Mon, 13 May 2013 18:17:58 -0400
Matthew Woehlke  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:
> >
> > 
> > INCLUDE(ShlomifCommon)
> > 
> >
> > 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.

Thanks! That worked.

> 
> 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).

OK.

> 
> 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.)
> 

OK.

> > 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?
> 

Using CPack’s "make package_source".

Regards,

Shlomi Fish


-- 
-
Shlomi Fish   http://www.shlomifish.org/
Why I Love Perl - http://shlom.in/joy-of-perl

C++ is complex, complexifying and complexified.
(With apologies to the Oxford English Dictionary).

Please reply to list if it's a mailing list post - http://shlom.in/reply .
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Creating a common (= across several projects) CMake module/include-file/library

2013-05-13 Thread Jean-Christophe Fillion-Robin
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

Hth
Jc


On Mon, May 13, 2013 at 6:17 PM, Matthew Woehlke <
matthew.woeh...@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:
>>
>> 
>> INCLUDE(ShlomifCommon)
>> 
>>
>> 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
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/**CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake
>



-- 
+1 919 869 8849
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Re: [CMake] Creating a common (= across several projects) CMake module/include-file/library

2013-05-13 Thread Matthew Woehlke

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:


INCLUDE(ShlomifCommon)


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

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Creating a common (= across several projects) CMake module/include-file/library

2013-05-11 Thread Shlomi Fish
Hi all,

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:



INCLUDE(ShlomifCommon)



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. 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.

What would be the best way to achieve this?

Regards,

Shlomi Fish 

-- 
-
Shlomi Fish   http://www.shlomifish.org/
The Case for File Swapping - http://shlom.in/file-swap

There is no IGLU cabal! The former cabalists are trying to prove the
correctness of a program that proves the correctness of proofs of other
programs.

Please reply to list if it's a mailing list post - http://shlom.in/reply .
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
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

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake