[cmake-developers] Problem with find_path and Frameworks

Brad King brad.king at kitware.com
Wed May 25 14:09:53 EDT 2016


On 05/25/2016 01:25 PM, Harry Mallon wrote:
> I have quite a specific problem with find_path where "find_path(IOKIT_INCLUDE_DIR "IOKit/pci/IOPCIDevice.h")"
> returns "/System/Library/Frameworks/Kernel.framework/Headers/IOKit/pci" rather than
> "/System/Library/Frameworks/Kernel.framework/Headers/".

Thanks.  Please extend the Tests/RunCMake/find_path test to cover
this behavior.  You could add a bogus framework layout inside the
test source tree.  See Tests/RunCMake/README.rst for details of
the test infrastructure.

> +    while (*fullPart++ == *relPart++)

I think the logic can be simpler.

The intended logic here is to get back up to the ".framework/Headers"
directory.  Since the glob we use always appends exactly the original
file name after this, we can just clip off the matching number of
characters from the result.  Or, just search for the last occurrence
of ".framework/Headers/" and clip off there.

Thanks,
-Brad



More information about the cmake-developers mailing list