[cmake-developers] Making Config.cmake files safer

David Cole david.cole at kitware.com
Sat Nov 12 15:07:36 EST 2011


On Sat, Nov 12, 2011 at 2:48 PM, Alexander Neundorf <neundorf at kde.org> wrote:
> On Saturday 12 November 2011, David Cole wrote:
>> On Sat, Nov 12, 2011 at 12:23 PM, Alexander Neundorf <neundorf at kde.org>
> wrote:
>> > On Saturday 12 November 2011, Alexander Neundorf wrote:
>> >> Hi,
>> >>
>> >> I added a branch CheckImportedFileExistenceInConfigDotCMakeFiles cmake
>> >> stage.
>> >
>> > This is the commit:
>> > http://cmake.org/gitweb?p=stage/cmake.git;a=commitdiff;h=1b12babe0cef55a0
>> > d5531a9d0d453a15598eb467
>> >
>> > Alex
>> > --
>> >
>> > Powered by www.kitware.com
>> >
>> > Visit other Kitware open-source projects at
>> > http://www.kitware.com/opensource/opensource.html
>> >
>> > Please keep messages on-topic and check the CMake FAQ at:
>> > http://www.cmake.org/Wiki/CMake_FAQ
>> >
>> > Follow this link to subscribe/unsubscribe:
>> > http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>>
>> I think it's a good idea, but I'm not 100% happy with the error message.
>>
>>   "Imported file \\\"" << filename << "\\\" does not exist. Your
>> installation is broken"
>>
>> is less helpful than I'd like to see...
>>
>> How about something like:
>>
>>   "File 'filename' for imported target 'targetname' does not exist.
>> Try re-installing 'projectname' or contact 'projectname's' developers
>> (or mailing list)"
>
> I committed a somewhat improved version.
> The second sentence is the hard part. It now says "There must be a problem
> with the installation of this package." , which is vague enough.
> At that point in cmake we just know the filename of the file we are writing
> to, which does not necessarily have a close relation to the name of the
> package the user needs to install in his distro. Or under Windows...
>
> Or I could add a full explanation what went wrong and possible reasons, but
> this will be quite long for an error message.
>
> Alex
> --
>
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers
>

"which is vague enough"

My problem with the message is that it is vague.

It should tell the user what to do to resolve the problem. Otherwise,
if we cannot tell the user what to do, we should just say "imported
target file does not exist" and name the file.

We should not say things like "your installation is broken" or "there
must be a problem" -- that tells the user NOTHING useful, and is just
plain annoying. If we can't name the project/package whose
installation is broken, then we shouldn't say "the installation is
broken."



More information about the cmake-developers mailing list