Quantcast

Find script distribution strategy

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Find script distribution strategy

Barth
Hello,

Let be a project A developed and distributed by organization AA.
Let be another project B depending on A, developed by organization BB. B calls find_package(A) in its CMakeLists.txt as to get the dependencies libraries and includes.

How should FindA.cmake be distributed ?
Option 1: package A (eg. A.rpm) installs it in /usr/share/cmake/ (on Linux) so that it is found by B or any other project that needs it.
Option 2: package A installs it in a more specific location such as /opt/A/cmake. However, how would B find it ?
Option 3: package A doesn't install it anywhere and we let the developers of B download it manually.

I would go for option 1 but I am not really sure what is the standard way.

Thank you in advance
Barth
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Find script distribution strategy

Michael Wild
On 02/20/2012 04:32 PM, Barth wrote:

> Hello,
>
> Let be a project A developed and distributed by organization AA.
> Let be another project B depending on A, developed by organization BB. B
> calls find_package(A) in its CMakeLists.txt as to get the dependencies
> libraries and includes.
>
> How should FindA.cmake be distributed ?
> Option 1: package A (eg. A.rpm) installs it in /usr/share/cmake/ (on Linux)
> so that it is found by B or any other project that needs it.
> Option 2: package A installs it in a more specific location such as
> /opt/A/cmake. However, how would B find it ?
> Option 3: package A doesn't install it anywhere and we let the developers of
> B download it manually.
>
> I would go for option 1 but I am not really sure what is the standard way.
>
> Thank you in advance
> Barth

If A is built with CMake, AA should make it install AConfig.cmake in one
of the directories documented for the find_package command. See
http://www.cmake.org/Wiki/CMake/Tutorials/How_to_create_a_ProjectConfig.cmake_file
for a simplistic tutorial.

Otherwise BB can include FindA.cmake in its own package. If it is a
transitive dependency (i.e. people wanting to compile against B also
need to find A) it should be installed next to the BConfig.cmake which
uses it directly.

HTH

Michael

--

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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Find script distribution strategy

Alexander Neundorf-3
In reply to this post by Barth
On Monday 20 February 2012, Barth wrote:

> Hello,
>
> Let be a project A developed and distributed by organization AA.
> Let be another project B depending on A, developed by organization BB. B
> calls find_package(A) in its CMakeLists.txt as to get the dependencies
> libraries and includes.
>
> How should FindA.cmake be distributed ?
> Option 1: package A (eg. A.rpm) installs it in /usr/share/cmake/ (on Linux)
> so that it is found by B or any other project that needs it.
> Option 2: package A installs it in a more specific location such as
> /opt/A/cmake. However, how would B find it ?
> Option 3: package A doesn't install it anywhere and we let the developers
> of B download it manually.
>
> I would go for option 1 but I am not really sure what is the standard way.

From these three options, only option 3) is acceptable.
Michael is correct that it should install a AConfig.cmake file.
What you could also do is put FindA.cmake somewhere in the documentation of
package A, so developers can see how the Find-module should look like.

Alex
--

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