list(APPEND CMAKE_MODULE_PATH ${SKBUILD_CMAKE_MODULE_PATH})
find_package(PythonExtensions REQUIRED)
+
+if(CMAKE_SYSTEM_NAME STREQUAL "Darwin" AND
+ CMAKE_VERSION VERSION_GREATER_EQUAL "3.12")
+ # On macOS, find_package(PythonLibs ...) does not find the Python include
+ # directory or library when they were installed via homebrew.
+ # find_package(Python ...) is more robust, but only available on newer
+ # versions of CMake. If we are compiling cvc5 on macOS and we have a newer
+ # version of CMake available, we try to use find_package(Python ...) to find
+ # the paths.
+ find_package(Python COMPONENTS Development)
+ set(PYTHON_INCLUDE_DIRS "${Python_INCLUDE_DIRS}")
+ set(PYTHON_LIBRARY "${Python_LIBRARIES}")
+endif()
+
find_package(Cython 0.29 REQUIRED)
set(CYTHON_FLAGS "-X embedsignature=True")