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.

50 lines
1.4KB

  1. # Tries to find Jemalloc headers and libraries.
  2. #
  3. # Usage of this module as follows:
  4. #
  5. # find_package(jemalloc)
  6. #
  7. # Variables used by this module, they can change the default behaviour and need
  8. # to be set before calling find_package:
  9. #
  10. # JEMALLOC_ROOT_DIR Set this variable to the root installation of
  11. # Jemalloc if the module has problems finding
  12. # the proper installation path.
  13. #
  14. # Variables defined by this module:
  15. #
  16. # JEMALLOC_FOUND System has Jemalloc libs/headers
  17. # JEMALLOC_LIBRARIES The Jemalloc libraries
  18. # JEMALLOC_INCLUDE_DIR The location of Jemalloc headers
  19. if (ENABLE_JEMALLOC_STATIC)
  20. find_path(JEMALLOC_INCLUDE_DIR
  21. NAMES jemalloc.h
  22. HINTS ${JEMALLOC_ROOT_DIR}/include/jemalloc
  23. NO_DEFAULT_PATH)
  24. find_library(JEMALLOC_LIBRARIES
  25. NAMES jemalloc
  26. HINTS ${JEMALLOC_ROOT_DIR}/lib
  27. NO_DEFAULT_PATH)
  28. else ()
  29. find_path(JEMALLOC_INCLUDE_DIR
  30. NAMES jemalloc/jemalloc.h
  31. )
  32. find_library(JEMALLOC_LIBRARIES
  33. NAMES jemalloc
  34. )
  35. endif ()
  36. include(FindPackageHandleStandardArgs)
  37. find_package_handle_standard_args(JEMALLOC DEFAULT_MSG
  38. JEMALLOC_LIBRARIES
  39. JEMALLOC_INCLUDE_DIR)
  40. mark_as_advanced(
  41. JEMALLOC_ROOT_DIR
  42. JEMALLOC_LIBRARIES
  43. JEMALLOC_INCLUDE_DIR)