git clone https://github.com/radhikaj/protobuf_prototype
git submodule --init
cd protobuf
mkdir build
export CXX=/usr/bin/clang++-7
export CC=/use/bin/clang
cmake -Dprotobuf_WITH_ZLIB=OFF -Dprotobuf_BUILD_TESTS=OFF ../cmake
make
cmake -DCMAKE_INSTALL_PREFIX=/opt/protobuf ../cmake
sudo make install
export PKG_CONFIG_PATH=/opt/protobuf/lib/pkgconfig:${PKG_CONFIG_PATH}
export PATH=/opt/protobuf/bin:${PATH}
See sample's README.