如何在不使用 sudo 的情况下安装 nlohmann/json

即使没有 root 权限,在你的系统上安装 nlohmann/json 也非常简单。

在此示例中,我们将安装到 $HOME/usr

install_nlohmann_json.sh
git clone -b v3.11.3 https://github.com/nlohmann/json.git
cmake -DCMAKE_INSTALL_PREFIX=$HOME/usr .
make -j8 install

Check out similar posts by category: C/C++