FindBreakpad.cmake 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. ###############################################################################
  2. # CMake module to search for the mpv libraries.
  3. #
  4. # WARNING: This module is experimental work in progress.
  5. #
  6. # Based one FindVLC.cmake by:
  7. # Copyright (c) 2011 Michael Jansen <info@michael-jansen.biz>
  8. # Modified by Tobias Hieta <tobias@hieta.se>
  9. #
  10. # Redistribution and use is allowed according to the terms of the BSD license.
  11. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  12. #
  13. ###############################################################################
  14. #
  15. ### Global Configuration Section
  16. #
  17. SET(_BREAKPAD_REQUIRED_VARS BREAKPAD_INCLUDE_DIR BREAKPAD_LIBRARY)
  18. #
  19. ### BREAKPAD uses pkgconfig.
  20. #
  21. if(PKG_CONFIG_FOUND)
  22. pkg_check_modules(PC_BREAKPAD QUIET breakpad-client)
  23. endif(PKG_CONFIG_FOUND)
  24. #
  25. ### Look for the include files.
  26. #
  27. find_path(
  28. BREAKPAD_INCLUDE_DIR
  29. NAMES google_breakpad/common/breakpad_types.h
  30. PATH_SUFFIXES breakpad
  31. HINTS
  32. ${PC_BREAKPAD_INCLUDEDIR}
  33. ${PC_BREAKPAD_INCLUDE_DIRS} # Unused for BREAKPAD but anyway
  34. DOC "BREAKPAD include directory"
  35. )
  36. mark_as_advanced(BREAKPAD_INCLUDE_DIR)
  37. set(BREAKPAD_INCLUDE_DIRS ${BREAKPAD_INCLUDE_DIR})
  38. #
  39. ### Look for the libraries (BREAKPAD)
  40. #
  41. find_library(
  42. BREAKPAD_LIBRARY
  43. NAMES breakpad_client
  44. HINTS
  45. ${PC_BREAKPAD_LIBDIR}
  46. ${PC_BREAKPAD_LIBRARY_DIRS} # Unused for BREAKPAD but anyway
  47. PATH_SUFFIXES lib${LIB_SUFFIX}
  48. )
  49. get_filename_component(_BREAKPAD_LIBRARY_DIR ${BREAKPAD_LIBRARY} PATH)
  50. mark_as_advanced(BREAKPAD_LIBRARY)
  51. set(BREAKPAD_LIBRARY_DIRS _BREAKPAD_CORE_LIBRARY_DIR _BREAKPAD_LIBRARY_DIR)
  52. list(REMOVE_DUPLICATES BREAKPAD_LIBRARY_DIRS)
  53. mark_as_advanced(BREAKPAD_LIBRARY_DIRS)
  54. #
  55. ### Check if everything was found and if the version is sufficient.
  56. #
  57. include(FindPackageHandleStandardArgs)
  58. find_package_handle_standard_args(
  59. BREAKPAD
  60. REQUIRED_VARS ${_BREAKPAD_REQUIRED_VARS}
  61. VERSION_VAR BREAKPAD_VERSION_STRING
  62. )