Build S2 Geometry
Prerequisite
- You need to install Xcode from App Store
- Clone
googletestfrom GitHub and installopensslvia brew see below:
git clone https://github.com/google/googletest
# Note that there are `googlemock` and `googletest` under the root `googletest` dir,
# please use the more specific `googletest/googletest` as the `GTEST_ROOT`.
GTEST_ROOT=`realpath googletest/googletest`
# Because we need OpenSSL header files
brew install openssl
OPENSSL_ROOT=`brew --prefix openssl`
Build s2geometry
git clone https://github.com/google/s2geometry.git
cd s2geometry
mkdir build
cd build
cmake -DOPENSSL_INCLUDE_DIR=${OPENSSL_ROOT}/include -DGTEST_ROOT=${GTEST_ROOT} ..
make
make test
sudo make install
Run s2geometry tests in CLion
- Please go to
Preferences...->Build, Execution, Deployment->CMake - Select the
DebugProfile, then add-DOPENSSL_INCLUDE_DIR=${path_to_openssl_include}and-DGTEST_ROOT=${path_to_gtest_root}toCMake options. - Reload project in CLion then you should be able to run all unit tests.
Links
- Uber’s H3 project: https://eng.uber.com/h3/