-
Notifications
You must be signed in to change notification settings - Fork 26
/
CMakeLists.txt
41 lines (35 loc) · 950 Bytes
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
cmake_minimum_required(VERSION 3.13.0)
project(serial2mqtt VERSION 0.1.0)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g ")
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -g ")
set(PAHO_MQTT_C_LIBRARIES paho.mqtt.c)
# add suffix when using static Paho MQTT C library variant
if(PAHO_BUILD_STATIC)
set(_PAHO_MQTT_C_LIB_NAME ${_PAHO_MQTT_C_LIB_NAME}-static)
endif()
find_package(eclipse-paho-mqtt-c REQUIRED)
add_definitions(-DLINUX -std=c++11)
add_executable(serial2mqtt)
target_sources(serial2mqtt PRIVATE
src/Serial2Mqtt.cpp
src/LogFile.cpp
src/Sys.cpp
src/Timer.cpp
src/main.cpp
src/Config.cpp
src/Bytes.cpp
src/Log.cpp
src/Str.cpp
src/CircBuf.cpp
src/Sema.cpp
)
include_directories(src
ArduinoJson/src
)
target_link_libraries(serial2mqtt
eclipse-paho-mqtt-c::paho-mqtt3as-static
-lpthread
-lrt
-pthread
-latomic )