CMakeLists.txt 955 B

12345678910111213141516171819202122232425262728293031
  1. cmake_minimum_required(VERSION 3.1)
  2. project(TestIronPython C)
  3. set (Python_FIND_IMPLEMENTATIONS IronPython)
  4. find_package(Python ${Python_REQUESTED_VERSION} COMPONENTS Interpreter Compiler)
  5. if (NOT Python_FOUND)
  6. message (FATAL_ERROR "Fail to found Python ${Python_REQUESTED_VERSION}")
  7. endif()
  8. if (NOT Python_Interpreter_FOUND)
  9. message (FATAL_ERROR "Fail to found Python Interpreter")
  10. endif()
  11. if (NOT Python_INTERPRETER_ID STREQUAL "IronPython")
  12. message (FATAL_ERROR "Erroneous interpreter ID (${Python_INTERPRETER_ID})")
  13. endif()
  14. if (NOT Python_Compiler_FOUND)
  15. message (FATAL_ERROR "Fail to found Python Compiler")
  16. endif()
  17. if (NOT Python_COMPILER_ID STREQUAL "IronPython")
  18. message (FATAL_ERROR "Erroneous compiler ID (${Python_COMPILER_ID})")
  19. endif()
  20. if(NOT TARGET Python::Interpreter)
  21. message(SEND_ERROR "Python::Interpreter not found")
  22. endif()
  23. if(NOT TARGET Python::Compiler)
  24. message(SEND_ERROR "Python::Interpreter not found")
  25. endif()