find_path still using other paths with NO_DEFAULT_PATH on OSX

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

find_path still using other paths with NO_DEFAULT_PATH on OSX

CMake mailing list

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


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
https://cmake.org/mailman/listinfo/cmake