/cmake/breakpad.cmake

https://github.com/bluecherrydvr/bluecherry-client · CMake · 62 lines · 36 code · 9 blank · 17 comment · 2 complexity · f0328fef8d12626954707448ee287551 MD5 · raw file

  1. #
  2. # Copyright 2010-2013 Bluecherry
  3. #
  4. # This program is free software; you can redistribute it and/or
  5. # modify it under the terms of the GNU General Public License as
  6. # published by the Free Software Foundation; either version 2 of
  7. # the License, or (at your option) any later version.
  8. #
  9. # This program is distributed in the hope that it will be useful,
  10. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. # GNU General Public License for more details.
  13. #
  14. # You should have received a copy of the GNU General Public License
  15. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. #
  17. find_package (BreakpadClient REQUIRED)
  18. list (APPEND bluecherry_client_SRCS
  19. src/utils/Breakpad.cpp
  20. )
  21. include_directories (${BREAKPADCLIENT_INCLUDE_DIR_${CMAKE_BUILD_TYPE}})
  22. set (USE_BREAKPAD 1)
  23. if (APPLE)
  24. add_custom_target (create-symbols
  25. COMMAND ${MACOSX_BREAKPAD_BIN_DIR}/gather_symbols.sh ${CMAKE_BINARY_DIR}/bluecherry-client
  26. WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
  27. )
  28. elseif (UNIX)
  29. set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gstabs")
  30. list (APPEND CMAKE_INCLUDE_PATH ${LINUX_BREAKPAD_DIR})
  31. set (BREAKPAD_DUMPSYMS ${LINUX_BREAKPAD_DIR}/src/tools/linux/dump_syms/dump_syms)
  32. add_custom_target (create-symbols
  33. COMMAND python
  34. ${CMAKE_SOURCE_DIR}/scripts/symbolstore.py
  35. ${BREAKPAD_DUMPSYMS}
  36. ${CMAKE_BINARY_DIR}/bluecherry-client.symbols
  37. ${CMAKE_BINARY_DIR}/bluecherry-client
  38. DEPENDS bluecherry-client
  39. )
  40. elseif (WIN32)
  41. set (CMAKE_CXX_LINK_FLAGS ${CMAKE_CXX_LINK_FLAGS} /DEBUG)
  42. list (APPEND CMAKE_INCLUDE_PATH ${WIN32_BREAKPAD_SRC_DIR})
  43. endif (APPLE)
  44. list (APPEND bluecherry_client_LIBRARIES
  45. ${BREAKPADCLIENT_LIBRARIES_${CMAKE_BUILD_TYPE}}
  46. )
  47. #this has to ba added after appending breakpadclient libs
  48. if (UNIX)
  49. FIND_PACKAGE ( Threads REQUIRED )
  50. list (APPEND bluecherry_client_LIBRARIES
  51. ${CMAKE_THREAD_LIBS_INIT}
  52. )
  53. endif (UNIX)