Python 2: Fix detection of include folder on macOS
@@ -11,8 +11,14 @@ if (APPLE AND PYTHON2INTERP_FOUND)
execute_process (COMMAND ${PYTHON2_EXECUTABLE}-config --prefix
OUTPUT_VARIABLE PYTHON2_LIBRARY_PREFIX
OUTPUT_STRIP_TRAILING_WHITESPACE)
- set (PYTHON2_LIBRARY ${PYTHON2_LIBRARY_PREFIX}/lib/libpython${PYTHON2_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX})
- set (PYTHON2_INCLUDE_DIR ${PYTHON2_LIBRARY_PREFIX}/include/python${PYTHON2_VERSION})
+ set (PYTHON2_LIBRARY
+ ${PYTHON2_LIBRARY_PREFIX}/lib/libpython${PYTHON2_VERSION}${CMAKE_SHARED_LIBRARY_SUFFIX}
+ CACHE FILEPATH
+ "Filepath of the Python 2 library")
+ set (PYTHON2_INCLUDE_DIR
+ ${PYTHON2_LIBRARY_PREFIX}/include/python${PYTHON2_VERSION_MAJOR}.${PYTHON2_VERSION_MINOR}
+ CACHE PATH
+ "Path to the Python 2 include directory")
endif (APPLE AND PYTHON2INTERP_FOUND)
find_package (Python2Libs ${PYTHON2_VERSION} QUIET)
