官网:https://github.com/open-source-parsers/jsoncpp
源码:jsoncpp-1.9.5.tar.gz
Step 1:解压
tar -xvzf jsoncpp-1.9.5.tar.gz
cd jsoncpp-1.9.5/
Step 2:创建安装目录
mkdir arm_jsoncpp
Step 3:CMake 生成 makefile
创建编译目录
mkdir build
cd build/
新建文件 aarch64.cmake,添加如下内容
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_CXX_COMPILER aarch64-linux-gnu-g++)
SET(CMAKE_C_COMPILER aarch64-linux-gnu-gcc)
CMake 生成 makefile
cmake ../ -DCMAKE_TOOLCHAIN_FILE=./aarch64.cmake -DCMAKE_INSTALL_PREFIX=/home/xxx/share/3rdparty/jsoncpp-1.9.5/arm_jsoncpp -DBUILD_STATIC_LIBS=ON -DBUILD_SHARED_LIBS=ON -DJSONCPP_WITH_TESTS=OFF -G "Unix Makefiles"
Step 4:编译安装
make
make install