[cmake-developers] Namespaces

Alan W. Irwin irwin at beluga.phys.uvic.ca
Thu Jan 28 15:58:42 EST 2016


On 2016-01-28 19:58+0100 Pau Garcia i Quiles wrote:

> Unfortunately ExternalProject does not work well with find_package, e. g.
> this fill fail:
>
> CMakeLists.txt
> |
> \--- 3rdparty/CMakeLists.txt
> \--- server/CMakeLists.txt
>
> Where:
>
> 3rdparty/CMakeLists.txt contains ExternalProject_Add(QtZeroConf ...)
>
> and
>
> server/CMakeLists.txt contains find_package(QtZeroConf)

Hi Pau:

Your experience is contrary to mine. For example, in my epa_build
project (where I build all the many prerequisites of PLplot) I build a lot of
different libraries (such as Qt5 and the GTK+ stack of libraries) using
ExternalProject_Add, and I don't experience any difficulties using
find_package to find the installed results.

I assume find_package should work well with ExternalProject_Add for
you as well so long as (a) all your ExternalProject(s) are configured
to do both a build and install (not just a build), and (b) you are
being careful in server/CMakeLists.txt to set PATH,
CMAKE_LIBRARY_PATH, CMAKE_INCLUDE_PATH, and PKG_CONFIG_PATH
consistently with the install prefix used for the ExternalProject(s).

By the way, some versions of CMake-3.x.y have been plagued by
substantial find issues, and your bad experience with find_package
might be related to those issues.  However, I haven't experienced any
major find issues with CMake-3.3.2 so you might want to shift to that
version if you aren't using it already.

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-developers mailing list