mkdir -p build
cd build

if [[ ${HOST} =~ .*linux.* ]]; then
  sed -i 's|_qt5gui_find_extra_libs(EGL.*)|_qt5gui_find_extra_libs(EGL "EGL" "" "")|g' $PREFIX/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake
  sed -i 's|_qt5gui_find_extra_libs(OPENGL.*)|_qt5gui_find_extra_libs(OPENGL "GL" "" "")|g' $PREFIX/lib/cmake/Qt5Gui/Qt5GuiConfigExtras.cmake
fi

PIVY_CPP_FLAGS='-std=c++1z '

cmake -G "Ninja" \
    -D CMAKE_BUILD_TYPE="Release" \
    -D CMAKE_INSTALL_PREFIX:FILEPATH=$PREFIX \
    -D Python_EXECUTABLE:FILEPATH=$PREFIX/bin/python \
    ..

ninja install
