early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,18 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2775a3da..ddd81b04 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -67,12 +67,7 @@ option(WITH_THREADING "Include client library threading support?" ON)
if (WITH_THREADING)
add_definitions("-DWITH_THREADING")
if (WIN32)
- if (CMAKE_CL_64)
- set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x64\\pthreadVC2.lib)
- else (CMAKE_CL_64)
- set (PTHREAD_LIBRARIES C:\\pthreads\\Pre-built.2\\lib\\x86\\pthreadVC2.lib)
- endif (CMAKE_CL_64)
- set (PTHREAD_INCLUDE_DIR C:\\pthreads\\Pre-built.2\\include)
+ find_package(pthread REQUIRED)
elseif (ANDROID)
set (PTHREAD_LIBRARIES "")
set (PTHREAD_INCLUDE_DIR "")

View File

@@ -0,0 +1,12 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2775a3da..ef7ce14a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -55,6 +55,7 @@ endif (WITH_UNIX_SOCKETS AND NOT WIN32)
option(WITH_SOCKS "Include SOCKS5 support?" ON)
if (WITH_SOCKS)
+ find_package(Libwebsockets CONFIG REQUIRED)
add_definitions("-DWITH_SOCKS")
endif (WITH_SOCKS)

View File

@@ -0,0 +1,42 @@
diff --git a/apps/mosquitto_passwd/CMakeLists.txt b/apps/mosquitto_passwd/CMakeLists.txt
index 13a7d826..5e96f49c 100644
--- a/apps/mosquitto_passwd/CMakeLists.txt
+++ b/apps/mosquitto_passwd/CMakeLists.txt
@@ -13,6 +13,10 @@ if (WITH_TLS)
)
- target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES})
+ if(WIN32)
+ target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES} ws2_32 crypt32)
+ else()
+ target_link_libraries(mosquitto_passwd ${OPENSSL_LIBRARIES})
+ endif()
install(TARGETS mosquitto_passwd RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
endif (WITH_TLS)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index 31cc35e3..a1a3e01a 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -69,7 +69,7 @@ if (UNIX AND NOT APPLE AND NOT ANDROID)
endif (UNIX AND NOT APPLE AND NOT ANDROID)
if (WIN32)
- set (LIBRARIES ${LIBRARIES} ws2_32)
+ set (LIBRARIES ${LIBRARIES} ws2_32 crypt32)
endif (WIN32)
if (WITH_SRV)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9380a046..62ce99e5 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -189,7 +189,7 @@ if (UNIX)
endif (UNIX)
if (WIN32)
- set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32)
+ set (MOSQ_LIBS ${MOSQ_LIBS} ws2_32 crypt32)
endif (WIN32)
if (WITH_WEBSOCKETS)

View File

@@ -0,0 +1,20 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 9380a046..f2929e19 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -194,13 +194,13 @@ endif (WIN32)
if (WITH_WEBSOCKETS)
if (STATIC_WEBSOCKETS)
- set (MOSQ_LIBS ${MOSQ_LIBS} websockets_static)
+ set (MOSQ_LIBS ${MOSQ_LIBS} websockets)
if (WIN32)
set (MOSQ_LIBS ${MOSQ_LIBS} iphlpapi)
link_directories(${mosquitto_SOURCE_DIR})
endif (WIN32)
else (STATIC_WEBSOCKETS)
- set (MOSQ_LIBS ${MOSQ_LIBS} websockets)
+ set (MOSQ_LIBS ${MOSQ_LIBS} websockets_shared)
endif (STATIC_WEBSOCKETS)
endif (WITH_WEBSOCKETS)

View File

@@ -0,0 +1,76 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO eclipse/mosquitto
HEAD_REF master
REF v2.0.14
SHA512 4b7066acd7d8ecb05fef6089997632381c34ce6631b7106afedf95b7f72d7280e45c9b2f8cce49349bf599520770ebbebb68ff71930bc44b615d177b4056a945
PATCHES
0002-win64-support.patch
0003-add-find_package-libwebsockets.patch
0004-support-static-build.patch
0005-websocket-shared-lib-name.patch
)
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "static" STATIC_LINKAGE)
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DWITH_STATIC_LIBRARIES=${STATIC_LINKAGE}
-DWITH_SRV=OFF
-DWITH_WEBSOCKETS=ON
-DSTATIC_WEBSOCKETS=${STATIC_LINKAGE}
-DWITH_TLS=ON
-DWITH_TLS_PSK=ON
-DWITH_THREADING=ON
-DDOCUMENTATION=OFF
-DWITH_PLUGINS=OFF
-DWITH_CJSON=OFF
-DWITH_CLIENTS=OFF
-DWITH_APPS=OFF
-DWITH_BROKER=OFF
-DWITH_BUNDLED_DEPS=OFF
MAYBE_UNUSED_VARIABLES
WITH_WEBSOCKETS
STATIC_WEBSOCKETS
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}mosquitto${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}mosquittopp${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}mosquitto${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}mosquittopp${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}")
file(GLOB VERSIONED_LIBRARIES LIST_DIRECTORIES FALSE
"${CURRENT_PACKAGES_DIR}/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}mosquitto${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.*"
"${CURRENT_PACKAGES_DIR}/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}mosquittopp${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.*"
"${CURRENT_PACKAGES_DIR}/debug/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}mosquitto${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.*"
"${CURRENT_PACKAGES_DIR}/debug/lib/${VCPKG_TARGET_SHARED_LIBRARY_PREFIX}mosquittopp${VCPKG_TARGET_SHARED_LIBRARY_SUFFIX}.*"
)
if(NOT "x${VERSIONED_LIBRARIES}x" STREQUAL "xx")
file(REMOVE ${VERSIONED_LIBRARIES})
endif()
if(NOT "x${VCPKG_TARGET_IMPORT_LIBRARY_PREFIX}${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}x" STREQUAL "xx")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/${VCPKG_TARGET_IMPORT_LIBRARY_PREFIX}mosquitto${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/lib/${VCPKG_TARGET_IMPORT_LIBRARY_PREFIX}mosquittopp${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/${VCPKG_TARGET_IMPORT_LIBRARY_PREFIX}mosquitto${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}")
file(REMOVE "${CURRENT_PACKAGES_DIR}/debug/lib/${VCPKG_TARGET_IMPORT_LIBRARY_PREFIX}mosquittopp${VCPKG_TARGET_IMPORT_LIBRARY_SUFFIX}")
endif()
endif()
configure_file(${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake ${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake @ONLY)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

5
externals/vcpkg/ports/mosquitto/usage vendored Executable file
View File

@@ -0,0 +1,5 @@
The package mosquitto provides CMake targets:
find_package(mosquitto REQUIRED)
target_include_directories(main PRIVATE ${MOSQUITTO_INCLUDE_DIRS})
target_link_libraries(main PRIVATE ${MOSQUITTO_LIBRARIES})

View File

@@ -0,0 +1,15 @@
include(FindPackageHandleStandardArgs)
include(SelectLibraryConfigurations)
find_path(MOSQUITTO_INCLUDE_DIR mosquitto.h)
find_library(MOSQUITTO_LIBRARY_DEBUG NAMES mosquitto libmosquitto mosquitto_static libmosquitto_static NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED)
find_library(MOSQUITTO_LIBRARY_RELEASE NAMES mosquitto libmosquitto mosquitto_static libmosquitto_static NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED)
find_library(MOSQUITTOPP_LIBRARY_DEBUG NAMES mosquittopp libmosquittopp mosquittopp_static libmosquittopp_static NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/debug" NO_DEFAULT_PATH REQUIRED)
find_library(MOSQUITTOPP_LIBRARY_RELEASE NAMES mosquittopp libmosquittopp mosquittopp_static libmosquittopp_static NAMES_PER_DIR PATH_SUFFIXES lib PATHS "${_VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}" NO_DEFAULT_PATH REQUIRED)
select_library_configurations(MOSQUITTO)
select_library_configurations(MOSQUITTOPP)
set(MOSQUITTO_INCLUDE_DIRS ${MOSQUITTO_INCLUDE_DIR})
set(MOSQUITTO_LIBRARIES ${MOSQUITTO_LIBRARY} ${MOSQUITTOPP_LIBRARY})

18
externals/vcpkg/ports/mosquitto/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,18 @@
{
"name": "mosquitto",
"version": "2.0.14",
"description": "Mosquitto is an open source message broker that implements the MQ Telemetry Transport protocol versions 3.1 and 3.1.1, MQTT provides a lightweight method of carrying out messaging using a publish/subscribe model, This makes it suitable for machine to machine messaging such as with low power sensors or mobile devices such as phones, embedded computers or microcontrollers like the Arduino",
"homepage": "https://mosquitto.org/",
"license": "EPL-2.0",
"dependencies": [
"c-ares",
"libwebsockets",
"openssl",
"pthreads",
"uthash",
{
"name": "vcpkg-cmake",
"host": true
}
]
}