CMakeLists.txt 632 B

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