赞
踩
git clone https://github.com/eclipse/paho.mqtt.c.git
cd paho.mqtt.c
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=./install -DPAHO_WITH_SSL=ON
make -j12
make install
# 可以记录一下 install 路径,后面要用,
cd install
pwd #把地址复制下
git clone https://github.com/eclipse/paho.mqtt.cpp.git
# OpenSSL
if(OPENSSL_FOUND)
if(APPLE)
include_directories(/usr/local/Cellar/openssl@1.1/1.1.1d/include)
list(APPEND LIB_LIST /usr/local/Cellar/openssl@1.1/1.1.1d/lib/libssl.dylib)
list(APPEND LIB_LIST /usr/local/Cellar/openssl@1.1/1.1.1d/lib/libcrypto.dylib)
message(STATUS "OpenSSL Version: ${OPENSSL_VERSION} ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}")
else()
include_directories(${OPENSSL_INCLUDE_DIR})
list(APPEND LIB_LIST ${OPENSSL_LIBRARIES})
message(STATUS "OpenSSL Version: ${OPENSSL_VERSION} ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}")
endif()
brew install catch2
mkdir build
cd build
export OPENSSL_ROOT_DIR=/usr/local/Cellar/openssl@1.1/1.1.1d # brew的openssl的路径
cmake .. -DCMAKE_INSTALL_PREFIX=./install -DPAHO_BUILD_TESTS=OFF -DCMAKE_PREFIX_PATH=/Users/codefreedom/workspace/sources/paho.mqtt.c/build/install # 这里是刚才编译的 paho.c的路径
make -j12
make install
cd install # 配好的 paho.cpp就安装在这个路径下了
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。