Skip to content

Commit

Permalink
[mosquitto] Add vcpkg-cmake-wrapper.cmake and vcpkg.json (#12536)
Browse files Browse the repository at this point in the history
  • Loading branch information
LilyWangL authored Jul 31, 2020
1 parent cd6c4e1 commit 103939f
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 7 deletions.
6 changes: 0 additions & 6 deletions ports/mosquitto/CONTROL

This file was deleted.

5 changes: 4 additions & 1 deletion ports/mosquitto/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
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 changes: 5 additions & 0 deletions ports/mosquitto/usage
Original file line number Diff line number Diff line change
@@ -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})
15 changes: 15 additions & 0 deletions ports/mosquitto/vcpkg-cmake-wrapper.cmake
Original file line number Diff line number Diff line change
@@ -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})
13 changes: 13 additions & 0 deletions ports/mosquitto/vcpkg.json
Original file line number Diff line number Diff line change
@@ -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"
]
}

0 comments on commit 103939f

Please sign in to comment.