CMakeLists.txt 531 B

12345678910111213141516171819202122232425262728293031
  1. cmake_minimum_required(VERSION 3.14)
  2. project(TestFindBoostPython CXX)
  3. include(CTest)
  4. find_package(Boost OPTIONAL_COMPONENTS
  5. python27
  6. python34
  7. python35
  8. python36
  9. python37
  10. python38
  11. python39
  12. python310
  13. python311
  14. python312
  15. python313
  16. python314
  17. python315
  18. )
  19. set(FAILTEST TRUE)
  20. foreach (v IN ITEMS 27 34 35 36 37 38 39 310 311 312 313 314 315)
  21. if (Boost_PYTHON${v}_FOUND)
  22. set(FAILTEST FALSE)
  23. break()
  24. endif ()
  25. endforeach ()
  26. if (FAILTEST)
  27. message(FATAL_ERROR "No Boost Python module found")
  28. endif ()