#!/bin/bash

mkdir build
cd build
cmake \
  -DCMAKE_INSTALL_PREFIX="${PREFIX}" \
  -DCMAKE_INSTALL_LIBDIR="${PREFIX}/lib" \
  -DCMAKE_PREFIX_PATH="${PREFIX}" \
  -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  -DBUILD_STATIC_LIBS=1 \
  -DBUILD_SHARED_LIBS=1 \
  -DJSONCPP_WITH_TESTS=ON \
  -DJSONCPP_WITH_POST_BUILD_UNITTEST=ON \
  -DJSONCPP_WITH_PKGCONFIG_SUPPORT=ON \
  -DJSONCPP_WITH_CMAKE_PACKAGE=ON \
  -DPYTHON_EXECUTABLE="${SYS_PYTHON}" \
  ..

make -j${CPU_COUNT}
make install
