[CMake] FindPackage in config mode

Theodore Papadopoulo Theodore.Papadopoulo at inria.fr
Sun Jan 6 16:06:05 EST 2013


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

There is something I do not understand with FindPackage.
I often build multiple versions of the same packages, as a result
there are multiple versions of some config files (let's say
XXXConfig.cmake).
To be even more explicit, I build a set of complementary project under
a same root directory.

The problem I have is that I find no way of controlling which version
of the config files cmake finds (of course I can disable the feature
completely with NO_CMAKE_PACKAGE_REGISTRY, but that's not what I want).
What I would like is that cmake find the config file which shares the
longest path from root or at least the one that was generated most
recently. Instead, it seems to pick one of the file referred in .cmake
(I'm on linux) somewhat arbitrarily (it's not the oldest file, it's
not the first hash, it not the latest).

The problem is that this is quite difficult to diagnose and I do not
see a way of controlling it. I think that at leat the policy (if there
is one) should be documented somewhere.

The obvious workaround is to cleanup the .cmake  directory by hand
(even though I'm afraid that this will break some other of my builds....)

  Thanks for any idea/input.

	Theo.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlDp5z0ACgkQEr8WrU8nPV3IlQCfZNwrO4rw7CAMbbvVXG3rbKzN
fk4AoIGIkIdOtAMv+fwVo9cYX82FlYi3
=UmhK
-----END PGP SIGNATURE-----


More information about the CMake mailing list