# This script is intended to be run as part of the cmake for the code project.
# This script downloads, configures and builds the breakpad package. CASA will use
# breakpad to capture crashes of the various CASA applications. This file will put
# breakpad into a directory named "breakpad" that is directly below the build directory.
# The CASA application needs the breakpad header files and libbreakpad_client.a to
# build in the crash reporter functionality. Part of this file defines two
# variables, Breakpad_IncludeRoot which is to be used in a "-I" option during
# compilation of breakpad using code, and Breakpad_Libray which will be the
# path to the created libbreakpad_client.a.
# The source code will come from the breakpad site (part of Google's chromium project)
# and then require some manual work (see below) to create zipped tar file. This
# tar file will reside on a CASA server and be downloaded into the user's build tree
# during the cmake process. After download, the archive will be exploded, the
# package build configured, made and the library of interest copied. These operations
# will only occur when the expected artifacts are not present.
###############################################################################
##############################################################################
# How to create the breakpad archive file to put onto the CASA server
# 1) Download the depot tools package
# --> git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
# 2) Now download breakpad using a depot_tools script
# Apparently using "git" to clone the breakpad repo does not work correctly because
# some of the needed files are contained in unrelated git repos. Some of the depot
# tools handle this problem. If you try to use git directly, during the build step
# if will fail with some missing header files (paths will contain "/third_party/").
# --> PATH=../depot_tools:$PATH fetch --nohooks breakpad
# 3) Now change the name of the top-level breakpad directory (it will contain
# "configure") to "breakpad-distro". Probably --> mv breakpad breakpad-distro
# 4) Tar it up leaving out the .git tree
# --> tar czf breakpad-from-google-yymmdd breakpad-distro --exclude=.git
# # yymmdd is the date of this operation (e.g., 160531)
# # be sure to change the name timestamp in the lower part of this
macro (configure_breakpad Breakpad_Root)
# Derived from BreakpadInstall.in
message ("DEBUG BreakpadInstall-->CMakeLists.txt executing")
# Define a variable so that Breakpad clients can establish a
# dependency on this library.