Implementation.cmake 1.5 KB

123456789101112131415161718192021222324252627282930313233
  1. set (Python${Python_REQUESTED_VERSION}_FIND_IMPLEMENTATIONS ${Python_REQUESTED_IMPLEMENTATION})
  2. find_package(Python${Python_REQUESTED_VERSION} COMPONENTS Interpreter)
  3. if (NOT Python${Python_REQUESTED_VERSION}_FOUND OR NOT Python${Python_REQUESTED_VERSION}_Interpreter_FOUND)
  4. message (FATAL_ERROR "Failed to find Python${Python_REQUESTED_VERSION}")
  5. endif()
  6. if (Python_REQUESTED_IMPLEMENTATION STREQUAL "IronPython"
  7. AND NOT Python${Python_REQUESTED_VERSION}_INTERPRETER_ID STREQUAL "IronPython")
  8. message (FATAL_ERROR "Erroneous interpreter ID (${Python${Python_REQUESTED_VERSION}_INTERPRETER_ID})")
  9. endif()
  10. if (Python_REQUESTED_IMPLEMENTATION STREQUAL "CPython"
  11. AND Python${Python_REQUESTED_VERSION}_INTERPRETER_ID STREQUAL "IronPython")
  12. message (FATAL_ERROR "Erroneous interpreter ID (${Python${Python_REQUESTED_VERSION}_INTERPRETER_ID})")
  13. endif()
  14. set (Python_FIND_IMPLEMENTATIONS ${Python_REQUESTED_IMPLEMENTATION})
  15. find_package(Python ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter)
  16. if (NOT Python_FOUND OR NOT Python_Interpreter_FOUND)
  17. message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION}")
  18. endif()
  19. if (Python_REQUESTED_IMPLEMENTATION STREQUAL "IronPython"
  20. AND NOT Python_INTERPRETER_ID STREQUAL "IronPython")
  21. message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
  22. endif()
  23. if (Python_REQUESTED_IMPLEMENTATION STREQUAL "CPython"
  24. AND Python_INTERPRETER_ID STREQUAL "IronPython")
  25. message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
  26. endif()