1.新建文件夹
/home/yiweijiao/woke_lab/paho
2.解压paho.mqtt.c到/home/yiweijiao/woke_lab/paho/paho.mqtt.c
3.新建文件夹/home/yiweijiao/woke_lab/paho/openssl_lib
将已经交叉编译好的openssl复制到这里
4.cd /home/yiweijiao/woke_lab/paho/paho.mqtt.c
新建文件夹/home/yiweijiao/woke_lab/paho/paho.mqtt.c/build
5.进入build执行命令
cmake -DPAHO_WITH_SSL=TRUE -DOPENSSL_ROOT_DIR=/home/yiweijiao/woke_lab/paho/openssl_lib -DOPENSSL_LIB_SEARCH_PATH=/home/yiweijiao/woke_lab/paho/openssl_lib/lib/ -DOPENSSL_INC_SEARCH_PATH=/home/yiweijiao/woke_lab/paho/openssl_lib/include/openssl/ -DCMAKE_INSTALL_PREFIX=/home/yiweijiao/woke_lab/paho/paho.mqtt.c/build/output -DPAHO_BUILD_STATIC=TRUE -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc ..
6.执行make
7执行make install
8生成在/home/yiweijiao/woke_lab/paho/paho.mqtt.c/build/output
注意其中的文件夹路径需要根据自己实际的进行修改