[cmake-developers] Problem with find_path and Frameworks

Harry Mallon Harry at codexdigital.com
Wed May 25 13:25:39 EDT 2016


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/".

It is reproducible on OSX with the following CMakeLists.txt:

cmake_minimum_required(VERSION 3.0)
find_path(IOKIT_INCLUDE_DIR "IOKit/pci/IOPCIDevice.h")
message("Path returned: ${IOKIT_INCLUDE_DIR}")

Here is a patch which seems to fix it for me:


Harry Mallon
CODEX | Software Engineer
60 Poland Street | London | England | W1F 7NT
E harry at codexdigital.com | T +44 203 7000 989
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Fix-a-problem-where-using-find_path-to-find-a-header.patch
Type: application/octet-stream
Size: 1711 bytes
Desc: 0001-Fix-a-problem-where-using-find_path-to-find-a-header.patch
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20160525/41d35c28/attachment.obj>


More information about the cmake-developers mailing list