finding software with cmake

Matthew Woehlke mw_triad at users.sourceforge.net
Fri Aug 3 20:54:12 BST 2007


Matt Rogers wrote:
> On Thursday 02 August 2007 21:49, Alexander Neundorf wrote:
>> Regarding pkgconfig:
>> it is useful, but it has issues.
>> -it doesn't exist on all platforms
> 
> not true. see http://pkg-config.freedesktop.org/wiki/ where it explicitly 
> mentions Mac OS X and Windows.

So installing pkg-config should be a hard requirement for Windows?

>> -it doesn't work correctly if PKGCONFIG_PATH isn't set up correctly
> 
> not always true:
> matt at silver ~ $ echo $PKG_CONFIG_PATH
> 
> matt at silver ~ $ pkg-config --cflags glib-2.0
> -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include

Like everything else, it has defaults, yes. However if you install a 
pkg-config package in a non-default location, you must also set 
PKGCONFIG_PATH (if the build system is *relying* on pkg-config to find 
the package). I was bitten by this the other day when kdelibs was 
changed to *require* pkg-config to find strigi (previously, things Just 
Worked; after, CMake failed with a fatal error and I couldn't build 
kdelibs).

I'm with Alex, *relying* on pkg-config is a nuisance that should be 
avoided if possible.

>> Instead, if even with the changes above some stuff isn't found by the
>> FIND_XXX() commands, you can set the CMAKE_INCLUDE_PATH, CMAKE_PROGRAM_PATH
>> and  CMAKE_LIBRARY_PATH environment variables to tell cmake about
>> additional directories where FIND_XXX() should search.
> 
> Are these environment variables set in the shell or as arguments to cmake?

Both, I thought, but you'd have to check.

-- 
Matthew
"Non sequitor. Your facts are out of order." -- Nomad





More information about the kde-core-devel mailing list