[CMake] Interresting dependency problem

Alan W. Irwin irwin at beluga.phys.uvic.ca
Fri Sep 28 16:37:08 EDT 2007


On 2007-09-28 21:32+0200 Andreas Pakulat wrote:

> Well, anyway, tried it and there we are, unix-paths in the output so
> there's no way these flags can be used in a win32 native environment.
> However looking at the .pc files and the output of pkg-config as well as
> pkg-config --help it seems that at least the problem with moving libs
> and getting MSVC flags is solved. There's a --msvc-syntax switch (for
> usage of pkg-config inside cmake this doesn't matter anyway) and it also
> seems that some guessing happens when trying to choose a good prefix to
> set before the /lib or /include dirs. That guessing breaks as soon as I
> move the .pc files into a directory hierarchy that doesn't follow unix
> style though.
>
> Also when using pkg-config with cmake there's still the problem of
> having to "parse" its output and removing the various compiler flags
> (i.e -l, -L, -I), which can fail if the paths are weird. This shows that
> pkg-config is not being developed as a buildsystem-independent thing,
> but at least partly bound to autotools.

It appears from what you said that the pkg-config executable actually runs
in the non-MSYS case which exactly confirms what is claimed by the
pkg-config website.

As far as the rest of your objections are concerned, I believe pkg-config
just repackages in convenient form whatever is in the *.pc files so it
appears you have found some issues with *.pc files that are not configured
properly yet for certain software packages for the windows case.  I expect
this to be a common issue with porting applications that are developed on
Linux (where pkg-config is common) to windows platforms without MSYS.
Remember, before last year when knowledge of cmake first became widespread
in the Linux community virtually nobody was attempting to port their
Linux-developed applications to windows platforms without MSYS.

The important point is that now that you have shown the pkg-config
executable actually works without MSYS, all these platform-dependent issues
can straightforwardly be worked out.  For example, in the PLplot case we use
CMake to configure our *.pc files in any case, and it is straightforward to
change that configuration to any style of PATHS that is appropriate for the
platform. Similarly, when we import pkg-config information from other
packages using the PKG_CHECK_MODULES macro in FindPkgConfig.cmake it is
straightforward to parse that information into the appropriate internal form
needed by CMake.

Thanks for showing that the pkg-config executable actually runs for the
non-MSYS test.  That knowledge is fundamentally important to those Linux
software developers who are attempting to port their software to windows
without MSYS.

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); PLplot scientific plotting software
package (plplot.org); 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