aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLily <47812810+LilyWangL@users.noreply.github.com>2020-08-01 02:35:46 +0800
committerGitHub <noreply@github.com>2020-07-31 11:35:46 -0700
commit103939fa9b8bff139e36fce0554977050baa82f9 (patch)
tree06c201e9bf6fb6c6db9711f15ea5b651df1e259e
parentcd6c4e19fa4a7fcffdace70988454e51ddc35376 (diff)
downloadvcpkg-103939fa9b8bff139e36fce0554977050baa82f9.tar.gz
vcpkg-103939fa9b8bff139e36fce0554977050baa82f9.zip
[mosquitto] Add vcpkg-cmake-wrapper.cmake and vcpkg.json (#12536)
-rw-r--r--ports/mosquitto/CONTROL6
-rw-r--r--ports/mosquitto/portfile.cmake5
-rw-r--r--ports/mosquitto/usage5
-rw-r--r--ports/mosquitto/vcpkg-cmake-wrapper.cmake15
-rw-r--r--ports/mosquitto/vcpkg.json13
5 files changed, 37 insertions, 7 deletions
diff --git a/ports/mosquitto/CONTROL b/ports/mosquitto/CONTROL
deleted file mode 100644
index 6955ef15d..000000000
--- a/ports/mosquitto/CONTROL
+++ /dev/null
@@ -1,6 +0,0 @@
-Source: mosquitto
-Version: 1.6.8-1
-Build-Depends: c-ares, libwebsockets, openssl, pthreads
-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/download/
diff --git a/ports/mosquitto/portfile.cmake b/ports/mosquitto/portfile.cmake
index 2c04a7bb0..8c83401c9 100644
--- a/ports/mosquitto/portfile.cmake
+++ b/ports/mosquitto/portfile.cmake
@@ -46,4 +46,7 @@ if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/bin ${CURRENT_PACKAGES_DIR}/debug/bin)
endif()
-file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright) \ No newline at end of file
+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)
diff --git a/ports/mosquitto/usage b/ports/mosquitto/usage
new file mode 100644
index 000000000..1f4e6735c
--- /dev/null
+++ b/ports/mosquitto/usage
@@ -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})
diff --git a/ports/mosquitto/vcpkg-cmake-wrapper.cmake b/ports/mosquitto/vcpkg-cmake-wrapper.cmake
new file mode 100644
index 000000000..ad8124c67
--- /dev/null
+++ b/ports/mosquitto/vcpkg-cmake-wrapper.cmake
@@ -0,0 +1,15 @@
+include(FindPackageHandleStandardArgs)
+include(SelectLibraryConfigurations)
+
+find_path(MOSQUITTO_INCLUDE_DIR mosquitto.h)
+
+find_library(MOSQUITTO_LIBRARY_DEBUG NAMES mosquitto libmosquitto 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 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 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 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})
diff --git a/ports/mosquitto/vcpkg.json b/ports/mosquitto/vcpkg.json
new file mode 100644
index 000000000..c53470491
--- /dev/null
+++ b/ports/mosquitto/vcpkg.json
@@ -0,0 +1,13 @@
+{
+ "name": "mosquitto",
+ "version-string": "1.6.8",
+ "port-version": "2",
+ "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/download/",
+ "dependencies": [
+ "c-ares",
+ "libwebsockets",
+ "openssl",
+ "pthreads"
+ ]
+}