You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
936 B

2 months ago
  1. # Try to find hwloc libraries and headers.
  2. #
  3. # Usage of this module:
  4. #
  5. # find_package(hwloc)
  6. #
  7. # Variables defined by this module:
  8. #
  9. # HWLOC_FOUND System has hwloc libraries and headers
  10. # HWLOC_LIBRARIES The hwloc library
  11. # HWLOC_INCLUDE_DIRS The location of HWLOC headers
  12. find_path(
  13. HWLOC_PREFIX
  14. NAMES include/hwloc.h
  15. )
  16. if (NOT HWLOC_PREFIX AND NOT $ENV{HWLOC_BASE} STREQUAL "")
  17. set(HWLOC_PREFIX $ENV{HWLOC_BASE})
  18. endif()
  19. find_library(
  20. HWLOC_LIBRARIES
  21. NAMES hwloc
  22. HINTS ${HWLOC_PREFIX}/lib
  23. )
  24. find_path(
  25. HWLOC_INCLUDE_DIRS
  26. NAMES hwloc.h
  27. HINTS ${HWLOC_PREFIX}/include
  28. )
  29. include(FindPackageHandleStandardArgs)
  30. find_package_handle_standard_args(
  31. HWLOC DEFAULT_MSG
  32. HWLOC_LIBRARIES
  33. HWLOC_INCLUDE_DIRS
  34. )
  35. mark_as_advanced(
  36. HWLOC_LIBRARIES
  37. HWLOC_INCLUDE_DIRS
  38. )
  39. if (HWLOC_FOUND)
  40. if (NOT $ENV{HWLOC_LIB} STREQUAL "")
  41. # set(HWLOC_LIBRARIES "$ENV{HWLOC_LIB}")
  42. endif()
  43. endif()