mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-13 07:26:52 +01:00
Add CMakelists.txt for MQTTSNGateway #235
Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
|||||||
# Ian Craggs - initial version
|
# Ian Craggs - initial version
|
||||||
#*******************************************************************************/
|
#*******************************************************************************/
|
||||||
|
|
||||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
|
CMAKE_MINIMUM_REQUIRED(VERSION 3.1)
|
||||||
PROJECT("paho-mqttsn" CXX)
|
PROJECT("paho-mqttsn" CXX)
|
||||||
MESSAGE(STATUS "CMake version: " ${CMAKE_VERSION})
|
MESSAGE(STATUS "CMake version: " ${CMAKE_VERSION})
|
||||||
MESSAGE(STATUS "CMake system name: " ${CMAKE_SYSTEM_NAME})
|
MESSAGE(STATUS "CMake system name: " ${CMAKE_SYSTEM_NAME})
|
||||||
@@ -39,3 +39,4 @@ INCLUDE(CPack)
|
|||||||
ENABLE_TESTING()
|
ENABLE_TESTING()
|
||||||
|
|
||||||
ADD_SUBDIRECTORY(MQTTSNPacket)
|
ADD_SUBDIRECTORY(MQTTSNPacket)
|
||||||
|
ADD_SUBDIRECTORY(MQTTSNGateway)
|
||||||
16
MQTTSNGateway/CMakeLists.txt
Normal file
16
MQTTSNGateway/CMakeLists.txt
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
#*******************************************************************************
|
||||||
|
# Copyright (c) 2022 a1lu
|
||||||
|
#
|
||||||
|
# All rights reserved. This program and the accompanying materials
|
||||||
|
# are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
# and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||||
|
#
|
||||||
|
# The Eclipse Public License is available at
|
||||||
|
# http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
# and the Eclipse Distribution License is available at
|
||||||
|
# http://www.eclipse.org/org/documents/edl-v10.php.
|
||||||
|
#
|
||||||
|
# Contributors:
|
||||||
|
# a1lu - initial version
|
||||||
|
#*******************************************************************************/
|
||||||
|
ADD_SUBDIRECTORY(src)
|
||||||
113
MQTTSNGateway/src/CMakeLists.txt
Normal file
113
MQTTSNGateway/src/CMakeLists.txt
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
#*******************************************************************************
|
||||||
|
# Copyright (c) 2022 a1lu
|
||||||
|
#
|
||||||
|
# All rights reserved. This program and the accompanying materials
|
||||||
|
# are made available under the terms of the Eclipse Public License v1.0
|
||||||
|
# and Eclipse Distribution License v1.0 which accompany this distribution.
|
||||||
|
#
|
||||||
|
# The Eclipse Public License is available at
|
||||||
|
# http://www.eclipse.org/legal/epl-v10.html
|
||||||
|
# and the Eclipse Distribution License is available at
|
||||||
|
# http://www.eclipse.org/org/documents/edl-v10.php.
|
||||||
|
#
|
||||||
|
# Contributors:
|
||||||
|
# a1lu - initial version
|
||||||
|
#*******************************************************************************/
|
||||||
|
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ../Build)
|
||||||
|
set(CMAKE_CXX_STANDARD 11)
|
||||||
|
|
||||||
|
SET(OS linux)
|
||||||
|
SET(SENSORNET udp)
|
||||||
|
|
||||||
|
ADD_LIBRARY(mqtt-sngateway_common
|
||||||
|
MQTTGWConnectionHandler.cpp
|
||||||
|
MQTTGWPacket.cpp
|
||||||
|
MQTTGWPublishHandler.cpp
|
||||||
|
MQTTGWSubscribeHandler.cpp
|
||||||
|
MQTTSNGateway.cpp
|
||||||
|
MQTTSNGWBrokerRecvTask.cpp
|
||||||
|
MQTTSNGWBrokerSendTask.cpp
|
||||||
|
MQTTSNGWClient.cpp
|
||||||
|
MQTTSNGWClientRecvTask.cpp
|
||||||
|
MQTTSNGWClientSendTask.cpp
|
||||||
|
MQTTSNGWConnectionHandler.cpp
|
||||||
|
MQTTSNGWLogmonitor.cpp
|
||||||
|
MQTTSNGWPacket.cpp
|
||||||
|
MQTTSNGWPacketHandleTask.cpp
|
||||||
|
MQTTSNGWProcess.cpp
|
||||||
|
MQTTSNGWPublishHandler.cpp
|
||||||
|
MQTTSNGWSubscribeHandler.cpp
|
||||||
|
MQTTSNGWEncapsulatedPacket.cpp
|
||||||
|
MQTTSNGWForwarder.cpp
|
||||||
|
MQTTSNGWQoSm1Proxy.cpp
|
||||||
|
MQTTSNGWAdapter.cpp
|
||||||
|
MQTTSNGWAggregater.cpp
|
||||||
|
MQTTSNGWClientList.cpp
|
||||||
|
MQTTSNGWTopic.cpp
|
||||||
|
MQTTSNGWAdapterManager.cpp
|
||||||
|
MQTTSNAggregateConnectionHandler.cpp
|
||||||
|
MQTTSNGWMessageIdTable.cpp
|
||||||
|
MQTTSNGWAggregateTopicTable.cpp
|
||||||
|
${OS}/${SENSORNET}/SensorNetwork.cpp
|
||||||
|
${OS}/${SENSORNET}/SensorNetwork.h
|
||||||
|
${OS}/Timer.cpp
|
||||||
|
${OS}/Timer.h
|
||||||
|
${OS}/Network.cpp
|
||||||
|
${OS}/Network.h
|
||||||
|
${OS}/Threading.cpp
|
||||||
|
${OS}/Threading.h
|
||||||
|
)
|
||||||
|
|
||||||
|
include_directories(../../MQTTSNPacket/src)
|
||||||
|
link_directories("/usr/local/lib")
|
||||||
|
link_directories("/usr/local/opt/openssl/lib")
|
||||||
|
|
||||||
|
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(mqtt-sngateway_common
|
||||||
|
PUBLIC
|
||||||
|
.
|
||||||
|
${OS}
|
||||||
|
${OS}/${SENSORNET}
|
||||||
|
)
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(mqtt-sngateway_common
|
||||||
|
PRIVATE
|
||||||
|
MQTTSNPacketClient
|
||||||
|
MQTTSNPacketServer
|
||||||
|
pthread
|
||||||
|
ssl
|
||||||
|
crypto)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(MQTT-SNGateway
|
||||||
|
mainGateway.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(MQTT-SNGateway
|
||||||
|
mqtt-sngateway_common
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(MQTT-SNLogmonitor
|
||||||
|
mainLogmonitor.cpp
|
||||||
|
)
|
||||||
|
|
||||||
|
TARGET_LINK_LIBRARIES(MQTT-SNLogmonitor
|
||||||
|
mqtt-sngateway_common
|
||||||
|
)
|
||||||
|
|
||||||
|
ADD_EXECUTABLE(testPFW
|
||||||
|
tests/mainTestProcess.cpp
|
||||||
|
tests/TestProcess.cpp
|
||||||
|
tests/TestQue.cpp
|
||||||
|
tests/TestTree23.cpp
|
||||||
|
tests/TestTopics.cpp
|
||||||
|
tests/TestTopicIdMap.cpp
|
||||||
|
tests/TestTask.cpp
|
||||||
|
)
|
||||||
|
TARGET_LINK_LIBRARIES(testPFW
|
||||||
|
mqtt-sngateway_common
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
ADD_TEST(NAME testPFW
|
||||||
|
WORKING_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/..
|
||||||
|
COMMAND testPFW -f ./gateway.conf)
|
||||||
@@ -29,7 +29,6 @@
|
|||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace MQTTSNGW;
|
using namespace MQTTSNGW;
|
||||||
|
|
||||||
#define ARGV "./Build/testPFW"
|
|
||||||
#define CONFDIR "./"
|
#define CONFDIR "./"
|
||||||
#define CONF "gateway.conf"
|
#define CONF "gateway.conf"
|
||||||
|
|
||||||
@@ -63,7 +62,6 @@ void TestProcess::run(void)
|
|||||||
/* Test command line parameter */
|
/* Test command line parameter */
|
||||||
|
|
||||||
assert(1 == getArgc() || 3 == getArgc() );
|
assert(1 == getArgc() || 3 == getArgc() );
|
||||||
assert(0 == strcmp(ARGV, *getArgv()));
|
|
||||||
getParam("BrokerName", value);
|
getParam("BrokerName", value);
|
||||||
assert(0 == strcmp("mqtt.eclipse.org", value));
|
assert(0 == strcmp("mqtt.eclipse.org", value));
|
||||||
|
|
||||||
|
|||||||
@@ -22,3 +22,6 @@ ADD_LIBRARY(MQTTSNPacketClient SHARED MQTTSNConnectClient.c MQTTSNPacket.c MQTTS
|
|||||||
|
|
||||||
ADD_LIBRARY(MQTTSNPacketServer SHARED MQTTSNConnectServer.c MQTTSNPacket.c MQTTSNSearchServer.c MQTTSNSubscribeServer.c
|
ADD_LIBRARY(MQTTSNPacketServer SHARED MQTTSNConnectServer.c MQTTSNPacket.c MQTTSNSearchServer.c MQTTSNSubscribeServer.c
|
||||||
MQTTSNUnsubscribeServer.c MQTTSNSerializePublish.c MQTTSNDeserializePublish.c)
|
MQTTSNUnsubscribeServer.c MQTTSNSerializePublish.c MQTTSNDeserializePublish.c)
|
||||||
|
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(MQTTSNPacketClient PUBLIC .)
|
||||||
|
TARGET_INCLUDE_DIRECTORIES(MQTTSNPacketServer PUBLIC .)
|
||||||
Reference in New Issue
Block a user