CMakeLists.txt 918 B

12345678910111213141516171819202122232425262728293031
  1. cmake_minimum_required(VERSION 3.1)
  2. project(TestIronPython2 C)
  3. set (Python2_FIND_IMPLEMENTATIONS "IronPython")
  4. find_package(Python2 COMPONENTS Interpreter Compiler)
  5. if (NOT Python2_FOUND)
  6. message (FATAL_ERROR "Fail to found Python 2")
  7. endif()
  8. if (NOT Python2_Interpreter_FOUND)
  9. message (FATAL_ERROR "Fail to found Python 2 Interpreter")
  10. endif()
  11. if (NOT Python2_INTERPRETER_ID STREQUAL "IronPython")
  12. message (FATAL_ERROR "Erroneous interpreter ID (${Python2_INTERPRETER_ID})")
  13. endif()
  14. if (NOT Python2_Compiler_FOUND)
  15. message (FATAL_ERROR "Fail to found Python 2 Compiler")
  16. endif()
  17. if (NOT Python2_COMPILER_ID STREQUAL "IronPython")
  18. message (FATAL_ERROR "Erroneous compiler ID (${Python2_COMPILER_ID})")
  19. endif()
  20. if(NOT TARGET Python2::Interpreter)
  21. message(SEND_ERROR "Python2::Interpreter not found")
  22. endif()
  23. if(NOT TARGET Python2::Compiler)
  24. message(SEND_ERROR "Python2::Compiler not found")
  25. endif()