[CMake] find_path still using other paths with NO_DEFAULT_PATH on OSX

Lee, Jason jasonlee at lanl.gov
Thu Mar 7 12:59:33 EST 2019


Hi. I'm trying to use find_path to find a header file on OSX with variations of the call


find_path(SYS_XATTR
  NAMES xattr.h
  PATHS /usr/include
  PATH_SUFFIXES sys
  NO_DEFAULT_PATH)


However, no matter what is done, the path "/System/Library/Frameworks/Kernel.framework/Headers" is always selected (because there is a sys/xattr.h there), even though NO_DEFAULT_PATH should force find_path to only search "/usr/include".  Adding set(CMAKE_FIND_FRAMEWORK "NEVER") and set(CMAKE_FIND_APPBUNDLE "NEVER") does not make a difference.


I tried this with many different versions of CMake 3, and this is happening on all of them.


How do I get find_path to find the correct path?


Thank you.


Jason Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://cmake.org/pipermail/cmake/attachments/20190307/4b275cda/attachment.html>


More information about the CMake mailing list