Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[mosquitto] Add vcpkg-cmake-wrapper.cmake and vcpkg.json #12536

Merged
merged 1 commit into from
Jul 31, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
]
}