<commit_before>#!/bin/sh
set -o xtrace   # Write all commands first to stderr
set -o errexit  # Exit the script with error if any of the commands fail


if command -v gtar 2>/dev/null; then
   TAR=gtar
else
   TAR=tar
fi
$TAR xf ../libbson.tar.gz -C . --strip-components=1

SRCROOT=`pwd`
mkdir cmake
cd cmake
/opt/cmake/bin/cmake -Wno-dev -Werror -Wdeprecated --warn-uninitialized --warn-unused-vars -DCMAKE_INSTALL_PREFIX=`pwd` ..
make
make test
make install

# Test our CMake package config file
cd $SRCROOT/examples/cmake/find_package
/opt/cmake/bin/cmake -DCMAKE_PREFIX_PATH=$SRCROOT/cmake/lib/cmake .
make
LD_LIBRARY_PATH=$SRCROOT/cmake ./hello_bson

cd $SRCROOT/examples/cmake/FindPkgConfig
PKG_CONFIG_PATH=$SRCROOT/cmake /opt/cmake/bin/cmake .
make
LD_LIBRARY_PATH=$SRCROOT/cmake ./hello_bson<commit_msg>CDRIVER-1058 update cmake evergreen script<commit_after>#!/bin/sh
set -o xtrace   # Write all commands first to stderr
set -o errexit  # Exit the script with error if any of the commands fail

CMAKE=/opt/cmake/bin/cmake

if command -v gtar 2>/dev/null; then
   TAR=gtar
else
   TAR=tar
fi

SRCROOT=`pwd`

BUILD_DIR=$(pwd)/cbuild
rm -rf $BUILD_DIR
mkdir $BUILD_DIR

INSTALL_DIR=$(pwd)/install-dir
rm -rf $INSTALL_DIR
mkdir -p $INSTALL_DIR

cd $BUILD_DIR
$TAR xf ../../libbson.tar.gz -C . --strip-components=1
$CMAKE -Wno-dev -Werror -Wdeprecated --warn-uninitialized --warn-unused-vars -DCMAKE_INSTALL_PREFIX=$INSTALL_DIR .
make
make test
make install

# Test our CMake package config file
cd $SRCROOT/examples/cmake/find_package
$CMAKE -DCMAKE_PREFIX_PATH=$INSTALL_DIR/lib/cmake .
make
LD_LIBRARY_PATH=$INSTALL_DIR/lib ./hello_bson

cd $SRCROOT/examples/cmake/FindPkgConfig
PKG_CONFIG_PATH=$INSTALL_DIR/lib/pkgconfig /opt/cmake/bin/cmake .
make
LD_LIBRARY_PATH=$INSTALL_DIR/lib ./hello_bson
{'fraction_non_alphanumeric': 0.11327040533037201, 'fraction_numerical': 0.004441976679622432, 'mean_word_length': 4.284457478005865, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4017755', 'n_tokens_mistral': 718, 'n_tokens_neox': 694, 'n_words': 167}