[cmake-developers] [PATCH] Fix FindOpenCL on Mac OS

Matthäus G. Chajdas cmake at anteru.net
Fri Aug 5 16:09:28 EDT 2016


Hi,

all right. Yes, that sounds like a problem with
find_package_handle_standard_args, I wonder if setting the version to
0.0 by default would solve that particular problem?

_DIR and _DIRS is there because that seems to be true for most packages.

I'll push your patch this weekend - thanks again.

Cheers,
  Matthäus

Am 01.08.2016 um 21:04 schrieb jerry.c.t at web.de:
> Hi,
> 
>> The version is not listed as a required variable, so that's why it
>> passes through. If you pass in a version into your find_package call, it
>> should bail out if no version is specified.
> Sadly not. The current version in master does not fail when invoked with 
> "find_package(OpenCL 1.2 REQUIRED)". My first email shows exactly the 
> output. You see that it says "Required is at least version "1.2""
> while also saying "Found OpenCL:..." while also no version was found. The
> patch now fails if invoked for example with find_package(OpenCL 2.0 REQUIRED).
> It seems that  does not work as expected when
> OpenCL_VERSION_STRING is empty.
> 
>> I assume this was from testing, not
>> because that changed something on macOS?
> You are right _DIR and _DIRS are working.
> I think I only changed it because for example FindGLUT uses it, for the 
> library the singular variant LIBRARY is used and I
> don't understand the difference of _DIR and _DIRS :)
> 
> Jerry 
> 
> On 01.08.2016 14:32, Matthäus G. Chajdas wrote:
>> Hi Jerry,
>>
>> thanks for giving it a spin :)
>>
>> I don't have a Mac to test myself - as your changes are confined to
>> macOS, they look safe to me.
>>
>> The version is not listed as a required variable, so that's why it
>> passes through. If you pass in a version into your find_package call, it
>> should bail out if no version is specified.
>>
>> I only got one minor nit-pick: Why did you change the line
>> INTERFACE_INCLUDE_DIRECTORIES "${OpenCL_INCLUDE_DIR}")
>> to use _DIR instead of _DIRS? I assume this was from testing, not
>> because that changed something on macOS?
>>
>> Other than that, the patch looks good to me. I'll apply it this week.
>>
>> Cheers,
>>   Matthäus
>>



More information about the cmake-developers mailing list