[cmake-developers] Problem with find_path and Frameworks

Brad King brad.king at kitware.com
Thu May 26 09:17:44 EDT 2016


On 05/26/2016 07:24 AM, Harry Mallon wrote:
> I can work around it if need be. I just felt that it was against the
> stated behaviour of find_path since that function is meant to give
> the folder where you can find "IOKit/pci/IOPCIDevice.h" rather than
> the folder where you can find "IOPCIDevice.h".

Yes.  The current implementation was clearly written for the

 find_path(OPENAL_INCLUDE_DIR "al.h")

case without considering that it might be a header included using
slashes.  Harry's proposed patch fixes that.

>> On 25 May 2016, at 20:44, Eric Wing wrote:
>> There are two common use cases that it was designed to handle:
>>
>> case 1: #import <Cocoa/Cocoa.h>
>> find_path(COCOA_INCLUDE_DIR “Cocoa/Cocoa.h”)
>> # Returns something like /System/Library/Frameworks/Cocoa.framework
>>
>> case 2: #include “al.h”
>> find_path(OPENAL_INCLUDE_DIR “al.h”)
>> # Returns something like /System/Library/Frameworks/OpenAL.framework/Headers

The proposed change doesn't break either of these cases AFAICT.

I think the only compatibility concern is for projects that previously
worked around this bug that would therefore be broken by a fix.  The
case seems obscure enough that this may not be a problem.  Local builds
of old versions of such projects can easily be made to work by manually
setting the cache entry with the find_path result.  If it becomes a
major problem we can always revert the change and re-introduce it with
a policy for compatibility.

Harry, please see my review of the change in the other branch of
this thread.

Thanks,
-Brad



More information about the cmake-developers mailing list