[cmake-developers] Is there a way to avoid LOCATION property with Qt5?

Nils Gladitz nilsgladitz at gmail.com
Tue Apr 28 02:45:37 EDT 2015


On 04/28/2015 08:00 AM, Alan W. Irwin wrote:
> The Qt5 cmake documentation at
> <http://doc.qt.io/qt-5/cmake-manual.html> which Steve has referred me
> to before states you should use the LOCATION property of targets to
> determine the actual path to libraries. The PLplot build system
> requires those locations so it can transform them into the -L and -l
> form required to generate its pkg_config *.pc files.
>
> Some time ago I got this process to work fine for CMP0026 OLD and Qt5, but
> what is the alternative I should use for the CMP0026 NEW case (which
> disallows using the LOCATION property for targets)?
>
> Note PLplot uses a minimum CMake version of 3.0.2 so I am looking for
> a CMP0026 NEW solution that works for that version or above for Qt5.

CMP0026 only applies to build targets.

The location of build targets is still in flux during configuration 
which is why getting the location of those during configuration time is 
unsafe.

For imported targets this does not apply since their location is fixed.

For which configuration LOCATION returns isn't defined but I suppose 
that may not matter for pkg-config.

Otherwise you may want to look into LOCATION_<CONFIG>.

Nils



More information about the cmake-developers mailing list