forked from SmilyOrg/rfmqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
34 lines (26 loc) · 1.03 KB
/
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
cmake_minimum_required(VERSION 3.2)
include(ExternalProject)
project(rfmqtt C CXX)
set(includes
src/vendor/
src/vendor/yaml-cpp/include/
src/vendor/paho.mqtt.c/src/
)
set(sources
src/rfmqtt.cpp
src/vendor/cbuffer/cbuffer.c
)
add_subdirectory(src/vendor/yaml-cpp EXCLUDE_FROM_ALL)
add_subdirectory(src/vendor/docopt EXCLUDE_FROM_ALL)
add_subdirectory(src/vendor/paho.mqtt.c EXCLUDE_FROM_ALL)
set(CMAKE_CXX_STANDARD 11) # C++11...
set(CMAKE_CXX_STANDARD_REQUIRED ON) #...is required...
set(CMAKE_CXX_EXTENSIONS OFF) #...without compiler extensions like gnu++11
set(CMAKE_CXX_FLAGS "-Wall -Wno-long-long -pedantic")
add_executable(rfmqtt ${sources})
target_link_libraries(rfmqtt wiringPi yaml-cpp docopt pthread paho-mqtt3c)
target_include_directories(rfmqtt PRIVATE ${includes})
# add_custom_command(TARGET rfmqtt POST_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy_if_different
# "${PROJECT_SOURCE_DIR}/build/src/vendor/paho.mqtt.c/src/$<CONFIGURATION>/paho-mqtt3c.dll"
# $<TARGET_FILE_DIR:rfmqtt>/paho-mqtt3c.dll)