boost_mpi-config.cmake 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Generated by Boost 1.76.0
  2. if(TARGET Boost::mpi)
  3. return()
  4. endif()
  5. if(Boost_VERBOSE OR Boost_DEBUG)
  6. message(STATUS "Found boost_mpi ${boost_mpi_VERSION} at ${boost_mpi_DIR}")
  7. endif()
  8. mark_as_advanced(boost_mpi_DIR)
  9. # Compute the include and library directories relative to this file.
  10. get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" REALPATH)
  11. # If the computed and the original directories are symlink-equivalent, use original
  12. if(EXISTS "C:/Program Files/Boost/lib/cmake")
  13. get_filename_component(_BOOST_CMAKEDIR_ORIGINAL "C:/Program Files/Boost/lib/cmake" REALPATH)
  14. if(_BOOST_CMAKEDIR STREQUAL _BOOST_CMAKEDIR_ORIGINAL)
  15. set(_BOOST_CMAKEDIR "C:/Program Files/Boost/lib/cmake")
  16. endif()
  17. unset(_BOOST_CMAKEDIR_ORIGINAL)
  18. endif()
  19. get_filename_component(_BOOST_INCLUDEDIR "${_BOOST_CMAKEDIR}/../../include/boost-1_76/" ABSOLUTE)
  20. get_filename_component(_BOOST_LIBDIR "${_BOOST_CMAKEDIR}/../" ABSOLUTE)
  21. include(${CMAKE_CURRENT_LIST_DIR}/../BoostDetectToolset-1.76.0.cmake)
  22. if(Boost_DEBUG)
  23. message(STATUS "Scanning ${CMAKE_CURRENT_LIST_DIR}/libboost_mpi-variant*.cmake")
  24. endif()
  25. file(GLOB __boost_variants "${CMAKE_CURRENT_LIST_DIR}/libboost_mpi-variant*.cmake")
  26. macro(_BOOST_SKIPPED fname reason)
  27. if(Boost_VERBOSE OR Boost_DEBUG)
  28. message(STATUS " [ ] ${fname}")
  29. endif()
  30. list(APPEND __boost_skipped "${fname} (${reason})")
  31. endmacro()
  32. list(LENGTH __boost_variants _BOOST_SINGLE_VARIANT)
  33. if(NOT _BOOST_SINGLE_VARIANT EQUAL 1)
  34. set(_BOOST_SINGLE_VARIANT 0)
  35. endif()
  36. foreach(f IN LISTS __boost_variants)
  37. if(Boost_DEBUG)
  38. message(STATUS " Including ${f}")
  39. endif()
  40. include(${f})
  41. endforeach()
  42. unset(_BOOST_SINGLE_VARIANT)
  43. unset(_BOOST_LIBDIR)
  44. unset(_BOOST_INCLUDEDIR)
  45. unset(_BOOST_CMAKEDIR)
  46. if(NOT __boost_variants AND (Boost_VERBOSE OR Boost_DEBUG))
  47. message(STATUS " Library has no variants and is considered not found")
  48. endif()
  49. if(NOT TARGET Boost::mpi)
  50. set(__boost_message "No suitable build variant has been found.")
  51. if(__boost_skipped)
  52. set(__boost_message "${__boost_message}\nThe following variants have been tried and rejected:")
  53. foreach(s IN LISTS __boost_skipped)
  54. set(__boost_message "${__boost_message}\n* ${s}")
  55. endforeach()
  56. endif()
  57. set(boost_mpi_FOUND 0)
  58. set(boost_mpi_NOT_FOUND_MESSAGE ${__boost_message})
  59. unset(__boost_message)
  60. unset(__boost_skipped)
  61. unset(__boost_variants)
  62. unset(_BOOST_MPI_DEPS)
  63. return()
  64. endif()
  65. unset(__boost_skipped)
  66. unset(__boost_variants)
  67. if(_BOOST_MPI_DEPS)
  68. list(REMOVE_DUPLICATES _BOOST_MPI_DEPS)
  69. if(Boost_VERBOSE OR Boost_DEBUG)
  70. message(STATUS "Adding boost_mpi dependencies: ${_BOOST_MPI_DEPS}")
  71. endif()
  72. endif()
  73. foreach(dep_boost_mpi IN LISTS _BOOST_MPI_DEPS)
  74. set(_BOOST_QUIET)
  75. if(boost_mpi_FIND_QUIETLY)
  76. set(_BOOST_QUIET QUIET)
  77. endif()
  78. set(_BOOST_REQUIRED)
  79. if(boost_mpi_FIND_REQUIRED)
  80. set(_BOOST_REQUIRED REQUIRED)
  81. endif()
  82. get_filename_component(_BOOST_CMAKEDIR "${CMAKE_CURRENT_LIST_DIR}/../" ABSOLUTE)
  83. find_package(boost_${dep_boost_mpi} 1.76.0 EXACT CONFIG ${_BOOST_REQUIRED} ${_BOOST_QUIET} HINTS ${_BOOST_CMAKEDIR})
  84. set_property(TARGET Boost::mpi APPEND PROPERTY INTERFACE_LINK_LIBRARIES Boost::${dep_boost_mpi})
  85. unset(_BOOST_QUIET)
  86. unset(_BOOST_REQUIRED)
  87. unset(_BOOST_CMAKEDIR)
  88. if(NOT boost_${dep_boost_mpi}_FOUND)
  89. set(boost_mpi_FOUND 0)
  90. set(boost_mpi_NOT_FOUND_MESSAGE "A required dependency, boost_${dep_boost_mpi}, has not been found.")
  91. unset(_BOOST_MPI_DEPS)
  92. return()
  93. endif()
  94. endforeach()
  95. unset(_BOOST_MPI_DEPS)
  96. include(CMakeFindDependencyMacro)
  97. find_dependency(MPI)
  98. if(MPI_CXX_FOUND AND NOT TARGET MPI::MPI_CXX)
  99. if(MPI_CXX_COMPILE_FLAGS)
  100. set_property(TARGET Boost::mpi APPEND PROPERTY INTERFACE_COMPILE_OPTIONS "${MPI_CXX_COMPILE_FLAGS}")
  101. endif()
  102. if(MPI_CXX_INCLUDE_PATH)
  103. set_property(TARGET Boost::mpi APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${MPI_CXX_INCLUDE_PATH}")
  104. endif()
  105. if(MPI_CXX_LINK_FLAGS)
  106. set_property(TARGET Boost::mpi APPEND PROPERTY INTERFACE_LINK_OPTIONS "SHELL:${MPI_CXX_LINK_FLAGS}")
  107. endif()
  108. if(MPI_CXX_LIBRARIES)
  109. set_property(TARGET Boost::mpi APPEND PROPERTY INTERFACE_LINK_LIBRARIES "${MPI_CXX_LIBRARIES}")
  110. endif()
  111. else()
  112. set_property(TARGET Boost::mpi APPEND PROPERTY INTERFACE_LINK_LIBRARIES MPI::MPI_CXX)
  113. endif()