CMakeLists.txt 677 B

12345678910111213141516171819202122
  1. cmake_minimum_required(VERSION 3.1)
  2. project(TestIronPython C)
  3. find_package(Python ${Python_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter Compiler)
  4. if (NOT Python_FOUND)
  5. message (FATAL_ERROR "Fail to found Python ${Python_REQUESTED_VERSION}")
  6. endif()
  7. if (NOT Python_Compiler_FOUND)
  8. message (FATAL_ERROR "Fail to found Python Compiler")
  9. endif()
  10. if (NOT Python_COMPILER_ID STREQUAL "IronPython")
  11. message (FATAL_ERROR "Erroneous compiler ID (${Python_COMPILER_ID})")
  12. endif()
  13. if(NOT TARGET Python::Interpreter)
  14. message(SEND_ERROR "Python::Interpreter not found")
  15. endif()
  16. if(NOT TARGET Python::Compiler)
  17. message(SEND_ERROR "Python::Interpreter not found")
  18. endif()