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

Can this package be added to vcpkg? #77

Open
jmin911 opened this issue Mar 31, 2017 · 4 comments
Open

Can this package be added to vcpkg? #77

jmin911 opened this issue Mar 31, 2017 · 4 comments

Comments

@jmin911
Copy link

jmin911 commented Mar 31, 2017

vcpkg is now the preferred way to install open source packages in Microsoft Visual C++.
Boost and Beast libraries are in there.
Can this package also be added to vcpkg? (GitHub.com/Microsoft/vcpkg)

@redboltz
Copy link
Owner

redboltz commented Apr 1, 2017

@jmin911 , thank you for the comments.
I'm new to vcpkg. I think that it is good that mqtt_client_cpp supports vcpkg.

I just glanced GitHub.com/Microsoft/vcpkg. But I don't understand how to do, so far.
Could you tell me the way?

@redboltz
Copy link
Owner

Now I've learned how to add mqtt_cpp to vcpkg.
Currently, mqtt_cpp contains boost/beast as the submodule. boost.beast will be merged the next release of the boost libraries. I think that after the next boost release I will add mqtt_cpp to vcpkg. It can minimize the dependency confusion.

@stoperro
Copy link

I'm successfully using mqtt-cpp with my local vcpkg right now (no tls, tested only client so far). Below is the port file I created for it, maybe somebody finds it useful. I've skipped the files outside of "include/mqtt/" as I prefer to have everything under directory for library. One thing I'm worried about is include directory - it's named "mqtt" which is a name that could potentially clash with some other mqtt library. Could it be changed to e.g. mqtt_cpp?

 ports/mqtt-cpp/CONTROL        |  4 ++++
 ports/mqtt-cpp/portfile.cmake | 17 +++++++++++++++++
 2 files changed, 21 insertions(+)

diff --git a/ports/mqtt-cpp/CONTROL b/ports/mqtt-cpp/CONTROL
new file mode 100644
index 0000000..8223b1d
--- /dev/null
+++ b/ports/mqtt-cpp/CONTROL
@@ -0,0 +1,4 @@
+Source: mqtt-cpp
+Version: 1.0.7
+Description: MQTT client for based on Boost.Asio
+Build-Depends: boost
diff --git a/ports/mqtt-cpp/portfile.cmake b/ports/mqtt-cpp/portfile.cmake
new file mode 100644
index 0000000..ce0431f
--- /dev/null
+++ b/ports/mqtt-cpp/portfile.cmake
@@ -0,0 +1,17 @@
+#header-only library
+include(vcpkg_common_functions)
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/mqtt_cpp-1.0.7)
+message("SOURCE_PATH ${SOURCE_PATH}")
+vcpkg_download_distfile(ARCHIVE
+    URLS "https://github.com/redboltz/mqtt_cpp/archive/v1.0.7.tar.gz"
+    FILENAME "mqtt_cpp-v_1.0.7.tar.gz"
+    SHA512 710bab22d53d344e9d7ceb099bc522a9ce65bdd684bde26af3c8e4af199e5d02356eb2602f121ef17147f0fade1eca319906cb85511c4c5bdab5cc241d4dbdff
+)
+vcpkg_extract_source_archive(${ARCHIVE})
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/LICENSE_1_0.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/mqtt-cpp)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/mqtt-cpp/LICENSE_1_0.txt ${CURRENT_PACKAGES_DIR}/share/mqtt-cpp/copyright)
+
+# Copy the cereal header files
+file(COPY ${SOURCE_PATH}/include/mqtt DESTINATION ${CURRENT_PACKAGES_DIR}/include)

@jonesmz
Copy link
Contributor

jonesmz commented Oct 17, 2019

@jmin911 @stoperro

I've substantially changed the cmake configuration files in this project.

Did that make the situation better, or worse, for you?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants