Talk:CMake:How To Find Libraries

From KitwarePublic
Jump to navigationJump to search

How package finding works

The find_package command will look in the module path for Find<name>.cmake, which is the typical way for finding libraries, and the more advanced one of the two. If no such file is found, it looks for <name>Config.cmake or <lower-case-name>-config.cmake, which are supposed to be installed by libraries (but no libraries currently seem to install them) and that don't do detection, but rather just contain hardcoded values for the installed library.

As far as I (recently got to) know, config-mode is the way to go, if you want you CMake-aware package to be found. From this paragraph one would guess that Module-mode was preferred. Maybe the text can be changed to better reflect that... Jzarl 17:28, 1 December 2010 (EST)


Nice tutorial on "How to write Find modules", and I haven't had the chance to use it but LibFindMacros.cmake seems to be a nice utility.

But, on a rather sentimental issue, I was shocked to see the following comment once I downloaded the file:

# ...

# Damn CMake developers made the UsePkgConfig system deprecated in the same release (2.6)
# where they added pkg_check_modules ...
# 

One can understand you anger, and mail groups are a good place to discuss these (I am sure you already have). But can we please remove such remarks from the distributed code?

thanks for the module.

--sly 13:36, 1 May 2009 (UTC)

LibFindMacros.cmake is awesome, but it's missing a license header, so it's unclear if it's compatible with BSD, GPL, etc.

Can you please add this, especially if you want it included within CMake proper.

Thanks for the module. --Vlovich 15:37, 24 May 2010 (UTC)