Skip to content

Commit 65a83b7

Browse files
committed
mosq as git submodule
1 parent 0493714 commit 65a83b7

File tree

5 files changed

+42
-8
lines changed

5 files changed

+42
-8
lines changed

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "third_party/mosquitto"]
2+
path = third_party/mosquitto
3+
url = https://github.com/eclipse/mosquitto

bootstrap.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
cd third_party
6+
./bootstrap.sh
7+
cd -
8+
9+
mkdir -p build
10+
11+
cd build
12+
13+
cmake \
14+
-DMOSQUITTO_INCLUDE_DIR=$PWD/third_party/mosquitto/lib/mosquitto.h \
15+
-DMOSQUITTO_LIBRARY=$PWD/third_party/mosquitto/build/lib/libmosquitto.so \
16+
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
17+
../
18+
19+
cd -

cmake/FindMosquitto.cmake

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@
55
# MOSQUITTO_LIBRARIES - List of libraries when using libmosquitto.
66
# MOSQUITTO_FOUND - True if libmosquitto found.
77

8-
find_path(
9-
MOSQUITTO_INCLUDE_DIR mosquitto.h
10-
HINTS ENV MOSQ_INCLUDE_DIR)
8+
if (NOT MOSQUITTO_INCLUDE_DIR)
9+
find_path(MOSQUITTO_INCLUDE_DIR mosquitto.h)
10+
endif()
1111

12-
find_library(
13-
MOSQUITTO_LIBRARY
14-
NAMES libmosquitto libmosquitto.so.1
15-
HINTS ${MOSQ_LIB_DIR} ENV MOSQ_LIB_DIR
16-
PATHS ${MOSQ_LIB_DIR} ENV MOSQ_LIB_DIR)
12+
if (NOT MOSQUITTO_LIBRARY)
13+
find_library(
14+
MOSQUITTO_LIBRARY
15+
NAMES libmosquitto libmosquitto.so.1 libmosquitto.dylid)
16+
endif()
1717

1818
include(FindPackageHandleStandardArgs)
1919

third_party/bootstrap.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
3+
cd mosquitto
4+
mkdir -p build
5+
cd build
6+
cmake \
7+
-DCMAKE_BUILD_TYPE=RelWithDebInfo
8+
-DWITH_SRV=off \
9+
../
10+
cd -
11+
make libmosquitto -C build

third_party/mosquitto

Submodule mosquitto added at 91bfd82

0 commit comments

Comments
 (0)