libigl-config.cmake.in 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. @PACKAGE_INIT@
  2. include(${CMAKE_CURRENT_LIST_DIR}/libigl-export.cmake)
  3. if (TARGET igl::core)
  4. if (NOT TARGET Eigen3::Eigen)
  5. find_package(Eigen3 QUIET)
  6. if (NOT Eigen3_FOUND)
  7. # try with PkgCOnfig
  8. find_package(PkgConfig REQUIRED)
  9. pkg_check_modules(Eigen3 QUIET IMPORTED_TARGET eigen3)
  10. endif()
  11. if (NOT Eigen3_FOUND)
  12. message(FATAL_ERROR "Could not find required dependency Eigen3")
  13. set(libigl_core_FOUND FALSE)
  14. else()
  15. set_target_properties(igl::core PROPERTIES INTERFACE_LINK_LIBRARIES PkgConfig::Eigen3)
  16. set(libigl_core_FOUND TRUE)
  17. endif()
  18. else()
  19. set_target_properties(igl::core PROPERTIES INTERFACE_LINK_LIBRARIES Eigen3::Eigen)
  20. set(libigl_core_FOUND TRUE)
  21. endif()
  22. endif()
  23. if (TARGET igl::common)
  24. if (NOT TARGET Eigen3::Eigen)
  25. find_package(Eigen3 QUIET)
  26. if (NOT Eigen3_FOUND)
  27. # try with PkgCOnfig
  28. find_package(PkgConfig REQUIRED)
  29. pkg_check_modules(Eigen3 QUIET IMPORTED_TARGET eigen3)
  30. endif()
  31. if (NOT Eigen3_FOUND)
  32. message(FATAL_ERROR "Could not find required dependency Eigen3")
  33. set(libigl_common_FOUND FALSE)
  34. else()
  35. set_target_properties(igl::common PROPERTIES INTERFACE_LINK_LIBRARIES PkgConfig::Eigen3)
  36. set(libigl_common_FOUND TRUE)
  37. endif()
  38. else()
  39. set_target_properties(igl::common PROPERTIES INTERFACE_LINK_LIBRARIES Eigen3::Eigen)
  40. set(libigl_common_FOUND TRUE)
  41. endif()
  42. endif()
  43. check_required_components(libigl)