1 Star 0 Fork 5

syfchao/tmsg

forked from zjzdy/tmsg 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
CMakeLists.txt 1.43 KB
一键复制 编辑 原始数据 按行查看 历史
zjzdy 提交于 2018-08-11 10:14 . Update CMakeLists.txt
cmake_minimum_required(VERSION 3.1)
project("tmsg" LANGUAGES CXX)
set(CMAKE_CXX_STANDARD 11)
set(SOURCE_FILES tmsg.cpp tmsg.hpp)
if(MSVC)
add_compile_options("/source-charset:utf-8")
endif()
include_directories(".")
include_directories("./3rdparty")
include_directories("../paho.mqtt.cpp/install/include" "../paho.mqtt.c/install/include")
find_library(MQTTC NAMES paho-mqtt3a PATHS "../paho.mqtt.c/install/lib")
find_library(MQTTCPP NAMES paho-mqttpp3 PATHS "../paho.mqtt.cpp/install/lib" "../paho.mqtt.cpp/install/bin")
message(STATUS "paho-mqtt3a lib path: " ${MQTTC})
message(STATUS "paho-mqttpp3 lib path: " ${MQTTCPP})
set(MQTTLIB ${MQTTCPP} ${MQTTC})
add_executable(Get example/get.cpp ${SOURCE_FILES})
target_link_libraries(Get ${MQTTLIB})
add_executable(Get2 example/get2.cpp ${SOURCE_FILES})
target_link_libraries(Get2 ${MQTTLIB})
add_executable(GetAll example/getAll.cpp ${SOURCE_FILES})
target_link_libraries(GetAll ${MQTTLIB})
add_executable(Pub example/pub.cpp ${SOURCE_FILES})
target_link_libraries(Pub ${MQTTLIB})
set(THREADS_PREFER_PTHREAD_FLAG ON)
find_package(Threads REQUIRED)
include_directories("./example/arduino2tmsg/3rdparty")
add_executable(Arduino2tmsg example/arduino2tmsg/arduino2tmsg.cpp ${SOURCE_FILES})
target_link_libraries(Arduino2tmsg ${MQTTLIB} Threads::Threads)
add_executable(Arduino2tmsg_auto example/arduino2tmsg/arduino2tmsg_auto.cpp ${SOURCE_FILES})
target_link_libraries(Arduino2tmsg_auto ${MQTTLIB} Threads::Threads)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
C++
1
https://gitee.com/syfchao/tmsg.git
git@gitee.com:syfchao/tmsg.git
syfchao
tmsg
tmsg
master

搜索帮助