IronPython.cmake 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. set (${PYTHON}_FIND_IMPLEMENTATIONS IronPython)
  2. if(PYTHON STREQUAL "Python")
  3. set(IronPython_VERSION "IronPython ${Python_REQUESTED_VERSION}")
  4. elseif(PYTHON STREQUAL "Python2")
  5. set(IronPython_VERSION "IronPython2")
  6. else()
  7. set(IronPython_VERSION "IronPython3")
  8. endif()
  9. find_package(${PYTHON} ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Compiler)
  10. if (NOT ${PYTHON}_FOUND)
  11. message (FATAL_ERROR "Failed to find Python ${Python_REQUESTED_VERSION}")
  12. endif()
  13. if (NOT ${PYTHON}_Interpreter_FOUND)
  14. message (FATAL_ERROR "Failed to find Python Interpreter")
  15. endif()
  16. if (NOT ${PYTHON}_INTERPRETER_ID STREQUAL "IronPython")
  17. message (FATAL_ERROR "Erroneous interpreter ID (${${PYTHON}_INTERPRETER_ID})")
  18. endif()
  19. if (NOT ${PYTHON}_Compiler_FOUND)
  20. message (FATAL_ERROR "Failed to find Python Compiler")
  21. endif()
  22. if (NOT ${PYTHON}_COMPILER_ID STREQUAL "IronPython")
  23. message (FATAL_ERROR "Erroneous compiler ID (${${PYTHON}_COMPILER_ID})")
  24. endif()
  25. if(NOT TARGET ${PYTHON}::Interpreter)
  26. message(SEND_ERROR "${PYTHON}::Interpreter not found")
  27. endif()
  28. if(NOT TARGET ${PYTHON}::Compiler)
  29. message(SEND_ERROR "${PYTHON}::Interpreter not found")
  30. endif()