cmake和json安装

一、cmake源码安装
官网下载源码:https://cmake.org/download/
安装:
./bootstrap
make
make install
cmake --version

二、json安装
下载源码:https://github.com/open-source-parsers/jsoncpp/tree/1.8.3
安装:
cd jsoncpp
mkdir -p ./build/debug
cd ./build/debug
cmake
-D CMAKE_BUILD_TYPE=debug
-D BUILD_STATIC_LIBS=ON
-D BUILD_SHARED_LIBS=OFF
-D CMAKE_INSTALL_PREFIX=/usr/local/jsoncpp
-D CMAKE_C_COMPILER=/usr/local/bin/gcc
-D CMAKE_CXX_COMPILER=/usr/local/bin/g++
-G "Unix Makefiles" ../..
make && make install

安装完后,编译代码是需要指定路径

原文地址:https://www.cnblogs.com/shuqingstudy/p/11370907.html