2 # Copyright 2022 The Chromium Authors.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 # This script is meant to be run once to setup the example demo agent.
7 # Run it with one command line argument: the path to a directory where the
8 # demo agent will be built. This should be a directory outside the SDK
9 # directory tree. By default, if no directory is supplied, a directory
10 # named `build` in the project root will be used.
12 # Once the build is prepared, the demo binary is built using the command
13 # `cmake --build <build-dir>`, where <build-dir> is the same argument given
18 export ROOT_DIR
=$
(realpath $
(dirname $0))
19 export DEMO_DIR
=$
(realpath
$ROOT_DIR/demo
)
20 export PROTO_DIR
=$
(realpath
$ROOT_DIR/proto
)
21 # Defaults to $ROOT_DIR/build if no argument is provided.
22 export BUILD_DIR
=$
(realpath
${1:-$ROOT_DIR/build})
24 echo Root dir
: $ROOT_DIR
25 echo Build dir
: $BUILD_DIR
26 echo Demo dir
: $DEMO_DIR
27 echo Proto dir
: $PROTO_DIR
29 # Prepare build directory
31 # Prepare protobuf out directory
32 mkdir
-p $BUILD_DIR/gen
33 # Enter build directory
36 # Install vcpkg and use it to install Google Protocol Buffers.
38 git clone https
://github.com
/microsoft
/vcpkg
39 .
/vcpkg
/bootstrap-vcpkg.sh
-disableMetrics
41 # Install any packages we want from vcpkg.
42 .
/vcpkg
/vcpkg
install protobuf
43 .
/vcpkg
/vcpkg
install gtest
45 # Generate the build files.
46 export CMAKE_TOOLCHAIN_FILE
=.
/vcpkg
/scripts
/buildsystems
/vcpkg.cmake