CMakeLists.txt 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. cmake_minimum_required(VERSION 3.1)
  2. project(TestPyPy C)
  3. set (Python_FIND_IMPLEMENTATIONS PyPy)
  4. find_package(Python ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Development)
  5. if (NOT Python_FOUND)
  6. message (FATAL_ERROR "Fail to found Python PyPy ${Python_REQUESTED_VERSION}")
  7. endif()
  8. if (NOT Python_Interpreter_FOUND)
  9. message (FATAL_ERROR "Fail to found Python PyPy Interpreter")
  10. endif()
  11. if (NOT Python_INTERPRETER_ID STREQUAL "PyPy")
  12. message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
  13. endif()
  14. if (NOT Python_Development.Module_FOUND)
  15. message (FATAL_ERROR "Fail to found Python PyPy ${Python_REQUESTED_VERSION} Development.Module")
  16. endif()
  17. if (NOT Python_Development.Embed_FOUND)
  18. message (FATAL_ERROR "Fail to found Python PyPy ${Python_REQUESTED_VERSION} Development.Embed")
  19. endif()
  20. if (NOT Python_Development_FOUND)
  21. message (FATAL_ERROR "Fail to found Python PyPy ${Python_REQUESTED_VERSION} Development")
  22. endif()
  23. if(NOT TARGET Python::Interpreter)
  24. message(SEND_ERROR "Python::Interpreter not found")
  25. endif()
  26. if(NOT TARGET Python::Module)
  27. message(SEND_ERROR "Python::Module not found")
  28. endif()
  29. if(NOT TARGET Python::Python)
  30. message(SEND_ERROR "Python::Python not found")
  31. endif()