PyPy.cmake 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. enable_language(C)
  2. set (${PYTHON}_FIND_IMPLEMENTATIONS PyPy)
  3. if(PYTHON STREQUAL "Python")
  4. set(PyPy_VERSION "PyPy ${Python_REQUESTED_VERSION}")
  5. elseif(PYTHON STREQUAL "Python2")
  6. set(PyPy_VERSION "PyPy2")
  7. else()
  8. set(PyPy_VERSION "PyPy3")
  9. endif()
  10. find_package(${PYTHON} ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Development)
  11. if (NOT ${PYTHON}_FOUND)
  12. message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION}")
  13. endif()
  14. if (NOT ${PYTHON}_Interpreter_FOUND)
  15. message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION} Interpreter")
  16. endif()
  17. if (NOT ${PYTHON}_INTERPRETER_ID STREQUAL "PyPy")
  18. message (FATAL_ERROR "Erroneous interpreter ID (${${PYTHON}_INTERPRETER_ID})")
  19. endif()
  20. if (NOT ${PYTHON}_Development.Module_FOUND)
  21. message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION} Development.Module")
  22. endif()
  23. if (NOT ${PYTHON}_Development.Embed_FOUND)
  24. message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION} Development.Embed")
  25. endif()
  26. if (NOT ${PYTHON}_Development_FOUND)
  27. message (FATAL_ERROR "Failed to find Python ${PyPy_VERSION} Development")
  28. endif()
  29. if(NOT TARGET ${PYTHON}::Interpreter)
  30. message(SEND_ERROR "${PYTHON}::Interpreter not found")
  31. endif()
  32. if(NOT TARGET ${PYTHON}::Module)
  33. message(SEND_ERROR "${PYTHON}::Module not found")
  34. endif()
  35. if(NOT TARGET ${PYTHON}::Python)
  36. message(SEND_ERROR "${PYTHON}::Python not found")
  37. endif()