[CMake] Volunteering to maintain two new Find Modules

Hendrik Sattler post at hendrik-sattler.de
Fri Jan 9 08:26:49 EST 2009


Philip Lowman schrieb:
> On Fri, Jan 9, 2009 at 7:32 AM, Philip Lowman <philip at yhbt.com> wrote:
> 
>> On Thu, Jan 8, 2009 at 5:22 PM, Albert Astals Cid <aacid at kde.org> wrote:
>>
>>> if (LibOpenJPEG_OPENJPEG_LIBRARY)
>>>  set (LibOpenJPEG_LIBRARIES ${openjpeg_LIBRARY})
>>> endif (LibOpenJPEG_OPENJPEG_LIBRARY)
>>
>> If you spot any find modules with this syntax this is wrong. The reason why
>> is if LibOpenJPEG_OPENJPEG_LIBRARY is NOTFOUND then LibOpenJPEG_LIBRARIES
>> will not be set to NOTFOUND and if the user is linking a target against the
>> LIBRARIES variable they will get no error because the variable will expand
>> to nothing.

I oppose. You can check LibOpenJPEG_FOUND if you want to test this or use
the REQUIRED keyword.
Using the *_LIBRARIES variables unconditionally should not lead to
errors for optional libraries.

HS


More information about the CMake mailing list