[CMake] Best practices/preferred methods for linking external libraries

Alan W. Irwin irwin at beluga.phys.uvic.ca
Sat Dec 3 17:53:48 EST 2011


On 2011-12-03 12:42-0800 Alan W. Irwin wrote:

> On 2011-12-02 19:33-0000 Matthew LeRoy wrote:
>> Assuming we want to just put the install tree in version control somewhere, 
>> and have ProjectB's
>> list files reference the install tree out of version control, is writing a 
>> Find module the best way
>> to do that?
>
> I don't see any way your highly unusual use case could work unless you
> adopt a common installation prefix for projectA that everybody can use
> on their various systems.

Hi Matt:

On second thought I got too negative about your strange use
case, and to answer your question directly for that case, yes, with a
Find module written for ProjectA,  then your ProjectB users can install
ProjectA anywhere, and if they set CMAKE_LIBRARY_PATH and
CMAKE_INCLUDE_PATH properly, they _should_ be able to get the Find
module to find libraries, headers, etc., from ProjectA regardless of
where it is installed.

That said, I am still a little surprised you are not taking the
traditional independent software package approach for ProjectA.

Alan

__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________

Linux-powered Science
__________________________


More information about the CMake mailing list