[CMake] Question about find package in Module mode

Andreas Pakulat apaku at gmx.de
Tue Oct 9 17:40:29 EDT 2012


Hi,

On Tue, Oct 9, 2012 at 5:39 PM, Fabio Fracassi
<fabio.fracassi at charite.de> wrote:
> On 10/9/12 5:05 PM, Andreas Pakulat wrote:
> On Tue, Oct 9, 2012 at 4:42 PM, Fabio Fracassi
> What do you mean with "package registry" here?
>
> It means the package registry where cmake stores previously build packages,
> which can be disabled with NO_CMAKE_PACKAGE_REGISTRY and is located in
> ~/.cmake/packages/<name>/* and which is searched as the 6th point.

Ah, never came across that part before. What happens if you explicitly
disable searching the package registry?

> Does that mean the
> files installed into /usr/local/ reference the builddir? If that is
> the case then you probably didn't generate the config files properly.
> Can you post the generated files as well as the corresponding
> install(EXPORT) and install(TARGETS ... EXPORT) lines?
>
> No, those are ok, and indeed work if I manualy point to the installed dir.
> It is just that for some reason CMake prefers
> ~/build/<MyLibrary>/<Mylibrary>-config.cmake over
> /usr/local/lib/CMake/<MyLibrary>/<Mylibrary>-config.cmake

Hmm, at this point I'd probably try cmake --trace and/or --debug-outpu
and maybe also the output of --system-information to find out why
cmake decides to load the config file from that location.

Oh and I assume that your client thats using the config has its own
build-directory, i.e. something like ~/build/<client>/ and there's no
CMakeCache.txt in ~/build/

Andreas


More information about the CMake mailing list