Add documentation and license
+# Copyright 2018 Uber Technologies, Inc.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This script is used to run the `coverage` target. In order to guarantee that
+# `coverage` is only a valid target in debug builds, we must know the build
+# mode. However, CMake tries to delay the selection of the build mode until
+# the build itself. This allows tools like Xcode to choose to build in debug
+# mode or release mode without rerunning CMake. In order to control the coverage
+# target based on the build mode, this script is regenerated whenever a new
+# build mode is selected, regardless of whether or not the `cmake` command is
+# invoked again.
+#
+# Example:
+#
+# ```
+# $ cmake -DCMAKE_BUILD_TYPE=Debug ..
+# $ xcodebuild -configuration Release # RunCoverage.cmake generated
+# $ xcodebuild -configuration Release # RunCoverage.cmake not regenerated
+# $ xcodebuild -configuration Debug # RunCoverage.cmake regenerated
+# ```
+
if($<BOOL:$<CONFIG:Debug>>)
get_filename_component(root_dir "${CMAKE_CURRENT_LIST_DIR}" DIRECTORY)
# Compile generated coverage counts into a single coverage.info
