[cmake-developers] find_package error wording

Brad King brad.king at kitware.com
Fri Feb 17 11:50:02 EST 2012


On 2/17/2012 11:37 AM, Alexander Neundorf wrote:
>>> developers use Find modules.  Consider:
>>>    CMake Error at CMakeLists.txt:7 (find_package):
>>>      No package configuration file for "ecm" found by names:
>>>        ecmConfig.cmake
>>>        ecm-config.cmake
>>>
>>>      Add the installation prefix of "ecm" to CMAKE_PREFIX_PATH or
>>>      set "ecm_DIR" to a directory containing one of the above files.
>>>
>>>      (If you are a developer expecting this find_package to load a
>>>
>>>       Findecm.cmake module then ensure it lies in CMAKE_MODULE_PATH.)
>>
>> I'm still not convinced.

Convinced of what?  I'm suggesting alternative wording for a change
you just committed yourself.

Whether to introduce the policy is another decision which should be
resolved before any changes for this end up in master.

> IOW: it's a quite common error to install a FindFoo.cmake as part of the
> package Foo into the prefix where foo is installed.

Any suggestion how to correct this misconception?  There is no place
in any of our documentation or tutorials on the wiki that suggests it.

> So if cmake knows that really the Find-module should have been found, it can
> produce a very clear error message that the missing Find-module must be part
> of the project itself or provided by another previously found package, and
> that the buildsystem is broken.

This discussion relates to the introduction of the policy you proposed.
Please comment on my question from yesterday:

On 2/16/2012 11:57 AM, Brad King wrote:
 > So your proposal when no extra find_package mode arg is given is:
 >
 > - search for FindFoo.cmake, use if found
 > - if not found, check new policy setting
 > - if not set, warn and follow OLD behavior
 > - if set to OLD, enter config mode and use current error if not found
 > - if set to NEW, present error about no FindFoo in module path
 >
 > ?
 >
 > Separately the CONFIG and MODULE explicit mode args can be given
 > to be alternative to NO_MODULE.

-Brad



More information about the cmake-developers mailing list