early-access version 2853
This commit is contained in:
84
externals/vcpkg/ports/paho-mqttpp3/fix-dependency.patch
vendored
Executable file
84
externals/vcpkg/ports/paho-mqttpp3/fix-dependency.patch
vendored
Executable file
@@ -0,0 +1,84 @@
|
||||
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
|
||||
index a9f8908..5c98f3f 100644
|
||||
--- a/cmake/CMakeLists.txt
|
||||
+++ b/cmake/CMakeLists.txt
|
||||
@@ -17,6 +17,5 @@ install(EXPORT ${package_name} DESTINATION lib/cmake/${package_name}
|
||||
|
||||
install(FILES
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${package_name}Config.cmake"
|
||||
- FindPahoMqttC.cmake
|
||||
"${CMAKE_CURRENT_BINARY_DIR}/${package_name}ConfigVersion.cmake"
|
||||
DESTINATION lib/cmake/${package_name})
|
||||
diff --git a/cmake/PahoMqttCppConfig.cmake.in b/cmake/PahoMqttCppConfig.cmake.in
|
||||
index 164e123..9beac1c 100644
|
||||
--- a/cmake/PahoMqttCppConfig.cmake.in
|
||||
+++ b/cmake/PahoMqttCppConfig.cmake.in
|
||||
@@ -5,7 +5,7 @@ set(PAHO_WITH_SSL @PAHO_WITH_SSL@)
|
||||
|
||||
include(CMakeFindDependencyMacro)
|
||||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
|
||||
-find_dependency(PahoMqttC REQUIRED)
|
||||
+find_dependency(eclipse-paho-mqtt-c REQUIRED)
|
||||
list(REMOVE_AT CMAKE_MODULE_PATH -1)
|
||||
find_dependency(Threads REQUIRED)
|
||||
|
||||
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
|
||||
index 3d43595..a25f74d 100644
|
||||
--- a/src/CMakeLists.txt
|
||||
+++ b/src/CMakeLists.txt
|
||||
@@ -23,7 +23,7 @@
|
||||
# Frank Pagliughi - made the shared library optional
|
||||
#*******************************************************************************/
|
||||
|
||||
-find_package(PahoMqttC REQUIRED)
|
||||
+find_package(eclipse-paho-mqtt-c CONFIG REQUIRED)
|
||||
|
||||
# --- The headers ---
|
||||
|
||||
@@ -81,13 +81,21 @@ target_include_directories(paho-cpp-objs
|
||||
## --- Build the shared library, if requested ---
|
||||
|
||||
if(PAHO_BUILD_SHARED)
|
||||
+ ## set PAHO_C_LIB
|
||||
+ if(PAHO_WITH_SSL)
|
||||
+ find_package(OpenSSL REQUIRED)
|
||||
+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as eclipse-paho-mqtt-c::paho-mqtt3cs)
|
||||
+ else()
|
||||
+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a eclipse-paho-mqtt-c::paho-mqtt3c)
|
||||
+ endif()
|
||||
+
|
||||
## create the shared library
|
||||
add_library(paho-mqttpp3 SHARED $<TARGET_OBJECTS:paho-cpp-objs>)
|
||||
|
||||
## add dependencies to the shared library
|
||||
target_link_libraries(paho-mqttpp3
|
||||
PRIVATE ${LIBS_SYSTEM}
|
||||
- PUBLIC PahoMqttC::PahoMqttC Threads::Threads)
|
||||
+ PUBLIC ${_PAHO_MQTT_C_LIB_NAME} Threads::Threads)
|
||||
|
||||
# It would be nice to exort the include paths from the obj lib, but we
|
||||
# get an export error. Perhaps in a future version?
|
||||
@@ -119,13 +127,22 @@ endif()
|
||||
## --- Build static version of the library, if requested ---
|
||||
|
||||
if(PAHO_BUILD_STATIC)
|
||||
+
|
||||
+ ## set PAHO_C_LIB
|
||||
+ if(PAHO_WITH_SSL)
|
||||
+ find_package(OpenSSL REQUIRED)
|
||||
+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3as-static eclipse-paho-mqtt-c::paho-mqtt3cs-static)
|
||||
+ else()
|
||||
+ set(_PAHO_MQTT_C_LIB_NAME eclipse-paho-mqtt-c::paho-mqtt3a-static eclipse-paho-mqtt-c::paho-mqtt3c-static)
|
||||
+ endif()
|
||||
+
|
||||
## create the static library
|
||||
add_library(paho-mqttpp3-static STATIC $<TARGET_OBJECTS:paho-cpp-objs>)
|
||||
|
||||
## add dependencies to the shared library
|
||||
target_link_libraries(paho-mqttpp3-static
|
||||
PRIVATE ${LIBS_SYSTEM}
|
||||
- PUBLIC PahoMqttC::PahoMqttC Threads::Threads)
|
||||
+ PUBLIC ${_PAHO_MQTT_C_LIB_NAME} Threads::Threads)
|
||||
|
||||
target_include_directories(paho-mqttpp3-static PUBLIC
|
||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
65
externals/vcpkg/ports/paho-mqttpp3/portfile.cmake
vendored
Executable file
65
externals/vcpkg/ports/paho-mqttpp3/portfile.cmake
vendored
Executable file
@@ -0,0 +1,65 @@
|
||||
# Download from Github
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO eclipse/paho.mqtt.cpp
|
||||
REF 33921c8b68b351828650c36816e7ecf936764379 #v1.2.0
|
||||
SHA512 3f4a91987e0106e50e637d8d4fb13a4f8aca14eea168102664fdcebd1260609434e679f5986a1c4d71746735530f1b72fc29d2ac05cb35b3ce734a6aab1a0a55
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-dependency.patch
|
||||
)
|
||||
|
||||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
|
||||
FEATURES
|
||||
"ssl" PAHO_WITH_SSL
|
||||
)
|
||||
|
||||
# Link with 'paho-mqtt3as' library
|
||||
set(PAHO_C_LIBNAME paho-mqtt3as)
|
||||
|
||||
# Setting the library path
|
||||
if (NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
|
||||
set(PAHO_C_LIBRARY_PATH "${CURRENT_INSTALLED_DIR}/lib")
|
||||
else()
|
||||
set(PAHO_C_LIBRARY_PATH "${CURRENT_INSTALLED_DIR}/debug/lib")
|
||||
endif()
|
||||
|
||||
# Setting the include path where MqttClient.h is present
|
||||
set(PAHO_C_INC "${CURRENT_INSTALLED_DIR}/include")
|
||||
|
||||
|
||||
# NOTE: the Paho C++ cmake files on Github are problematic.
|
||||
# It uses two different options PAHO_BUILD_STATIC and PAHO_BUILD_SHARED instead of just using one variable.
|
||||
# Unless the open source community cleans up the cmake files, we are stuck with setting both of them.
|
||||
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
||||
set(PAHO_MQTTPP3_STATIC ON)
|
||||
set(PAHO_MQTTPP3_SHARED OFF)
|
||||
set(PAHO_C_LIB "${PAHO_C_LIBRARY_PATH}/${PAHO_C_LIBNAME}")
|
||||
set(PAHO_OPTIONS -DPAHO_MQTT_C_LIBRARIES=${PAHO_C_LIB})
|
||||
else()
|
||||
set(PAHO_MQTTPP3_STATIC OFF)
|
||||
set(PAHO_MQTTPP3_SHARED ON)
|
||||
set(PAHO_OPTIONS)
|
||||
endif()
|
||||
|
||||
vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DPAHO_BUILD_STATIC=${PAHO_MQTTPP3_STATIC}
|
||||
-DPAHO_BUILD_SHARED=${PAHO_MQTTPP3_SHARED}
|
||||
-DPAHO_MQTT_C_INCLUDE_DIRS=${PAHO_C_INC}
|
||||
${FEATURE_OPTIONS}
|
||||
${PAHO_OPTIONS}
|
||||
)
|
||||
|
||||
# Run the build, copy pdbs and fixup the cmake targets
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_copy_pdbs()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME PahoMqttCpp CONFIG_PATH "lib/cmake/PahoMqttCpp")
|
||||
|
||||
# Remove the include and share folders in debug folder
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
# Add copyright
|
||||
file(INSTALL "${SOURCE_PATH}/about.html" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
30
externals/vcpkg/ports/paho-mqttpp3/vcpkg.json
vendored
Executable file
30
externals/vcpkg/ports/paho-mqttpp3/vcpkg.json
vendored
Executable file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "paho-mqttpp3",
|
||||
"version": "1.2.0",
|
||||
"port-version": 1,
|
||||
"description": "Paho project provides open-source C++ wrapper for Paho C library",
|
||||
"homepage": "https://github.com/eclipse/paho.mqtt.cpp",
|
||||
"license": "EPL-1.0",
|
||||
"dependencies": [
|
||||
"paho-mqtt",
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake-config",
|
||||
"host": true
|
||||
}
|
||||
],
|
||||
"default-features": [
|
||||
"ssl"
|
||||
],
|
||||
"features": {
|
||||
"ssl": {
|
||||
"description": "Build with SSL support",
|
||||
"dependencies": [
|
||||
"openssl"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user