让我说我有一个简单的CMake项目,其结构如下:
en
我的/ external / paho的CMakeList.txt如下:
/external
/gtest
/sqlite
/paho
/raspberry
/daemon
/cmake-build-debug
/lib
... libpaho*.so, libcrypto.so, etc..
/include
... openssl, MQTTClient.h etc...
因此,构建eclipse paho mqtt lib就像一个魅力一样,但是我不知道如何在/ raspberry / daemon项目中使用libpaho-mqtt3as.so,该项目当前看起来像:
cmake_minimum_required(VERSION 3.2)
include(ExternalProject)
ExternalProject_add(
libressl
URL https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.7.4.tar.gz
CONFIGURE_COMMAND ./configure --disable-hardening --prefix=${CMAKE_BINARY_DIR}
BUILD_IN_SOURCE 1)
externalproject_add(
paho
DEPENDS libressl
GIT_REPOSITORY "https://github.com/eclipse/paho.mqtt.c.git"
GIT_TAG "6f0edc21a3154b5be336c8f30a9b6f768da06e33"
UPDATE_COMMAND ""
PATCH_COMMAND ""
CMAKE_ARGS -DPAHO_WITH_SSL=TRUE -DBUILD_SHARED_LIBS=OFF -DOPENSSL_INC_SEARCH_PATH=${CMAKE_BINARY_DIR}/include -DOPENSSL_LIB_SEARCH_PATH=${CMAKE_BINARY_DIR}/lib -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}
BUILD_IN_SOURCE 1)
有什么想法吗?