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.

54 lines
1.1 KiB

  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. message(STATUS "Searching for hwloc library in path " ${HWLOC_PREFIX})
  20. find_library(
  21. HWLOC_LIBRARIES
  22. NAMES hwloc
  23. HINTS ${HWLOC_PREFIX}/lib
  24. )
  25. find_path(
  26. HWLOC_INCLUDE_DIRS
  27. NAMES hwloc.h
  28. HINTS ${HWLOC_PREFIX}/include
  29. )
  30. include(FindPackageHandleStandardArgs)
  31. find_package_handle_standard_args(
  32. HWLOC DEFAULT_MSG
  33. HWLOC_LIBRARIES
  34. HWLOC_INCLUDE_DIRS
  35. )
  36. mark_as_advanced(
  37. HWLOC_LIBRARIES
  38. HWLOC_INCLUDE_DIRS
  39. )
  40. if (HWLOC_FOUND)
  41. if (NOT $ENV{HWLOC_LIB} STREQUAL "")
  42. # set(HWLOC_LIBRARIES "$ENV{HWLOC_LIB}")
  43. endif()
  44. message(STATUS "hwloc includes: " ${HWLOC_INCLUDE_DIRS})
  45. message(STATUS "hwloc libraries: " ${HWLOC_LIBRARIES})
  46. endif()