From 45e7641ea0fe8c38e5c8f63e3ee234e080157067 Mon Sep 17 00:00:00 2001
From: alexander-smyslov <37107500+alexander-smyslov@users.noreply.github.com>
Date: Wed, 10 Apr 2019 08:01:34 +0200
Subject: [PATCH] [activemq-cpp] Add activemq-cpp library (#6017)
---
ports/activemq-cpp/CONTROL | 4 +
.../activemq-cpp/FunctionLevelLinkingOn.diff | 76 +++++++++++++++++
ports/activemq-cpp/portfile.cmake | 84 +++++++++++++++++++
3 files changed, 164 insertions(+)
create mode 100644 ports/activemq-cpp/CONTROL
create mode 100644 ports/activemq-cpp/FunctionLevelLinkingOn.diff
create mode 100644 ports/activemq-cpp/portfile.cmake
diff --git a/ports/activemq-cpp/CONTROL b/ports/activemq-cpp/CONTROL
new file mode 100644
index 0000000000..ee3c4300cf
--- /dev/null
+++ b/ports/activemq-cpp/CONTROL
@@ -0,0 +1,4 @@
+Source: activemq-cpp
+Version: 3.9.5
+Build-Depends: apr
+Description: Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns server.
diff --git a/ports/activemq-cpp/FunctionLevelLinkingOn.diff b/ports/activemq-cpp/FunctionLevelLinkingOn.diff
new file mode 100644
index 0000000000..8d00b1da60
--- /dev/null
+++ b/ports/activemq-cpp/FunctionLevelLinkingOn.diff
@@ -0,0 +1,76 @@
+diff --git a/vs2010-build/activemq-cpp.vcxproj b/vs2010-build/activemq-cpp.vcxproj
+index a43f072..54b4822 100644
+--- a/vs2010-build/activemq-cpp.vcxproj
++++ b/vs2010-build/activemq-cpp.vcxproj
+@@ -2576,7 +2576,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ Default
+- false
++ true
+ false
+ true
+
+@@ -2602,7 +2602,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ Default
+- false
++ true
+ false
+ true
+
+@@ -2628,7 +2628,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ Default
+- false
++ true
+ false
+ true
+
+@@ -2656,7 +2656,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ Default
+- false
++ true
+ false
+ true
+
+@@ -2684,7 +2684,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ Default
+- false
++ true
+ false
+ true
+
+@@ -2710,7 +2710,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ Default
+- false
++ true
+ false
+ true
+
+@@ -2736,7 +2736,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ Default
+- false
++ true
+ false
+ true
+
+@@ -2764,7 +2764,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ Default
+- false
++ true
+ false
+ true
+
diff --git a/ports/activemq-cpp/portfile.cmake b/ports/activemq-cpp/portfile.cmake
new file mode 100644
index 0000000000..b165efbcd2
--- /dev/null
+++ b/ports/activemq-cpp/portfile.cmake
@@ -0,0 +1,84 @@
+include(vcpkg_common_functions)
+
+if(VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
+ message(FATAL_ERROR "${PORT} does not currently support UWP")
+endif()
+
+set(VERSION 3.9.5)
+
+set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/activemq-cpp-library-${VERSION})
+vcpkg_download_distfile(ARCHIVE
+ URLS "https://www.apache.org/dist/activemq/activemq-cpp/${VERSION}/activemq-cpp-library-${VERSION}-src.tar.bz2"
+ FILENAME "activemq-cpp-library-${VERSION}-src.tar.bz2"
+ SHA512 83692d3dfd5ecf557fc88d204a03bf169ce6180bcff27be41b09409b8f7793368ffbeed42d98ef6374c6b6b477d9beb8a4a9ac584df9e56725ec59ceceaa6ae2
+)
+
+vcpkg_extract_source_archive_ex(
+ OUT_SOURCE_PATH SOURCE_PATH
+ ARCHIVE ${ARCHIVE}
+ PATCHES ${CMAKE_CURRENT_LIST_DIR}/FunctionLevelLinkingOn.diff
+)
+
+set(RELEASE_CONF "ReleaseDLL")
+set(DEBUG_CONF "DebugDLL")
+
+if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
+ set(BUILD_ARCH "Win32")
+ set(OUTPUT_DIR "Win32")
+elseif (VCPKG_TARGET_ARCHITECTURE MATCHES "x64")
+ set(BUILD_ARCH "x64")
+ set(OUTPUT_DIR "Win64")
+else()
+ message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}")
+endif()
+
+
+vcpkg_build_msbuild(
+ PROJECT_PATH ${SOURCE_PATH}/vs2010-build/activemq-cpp.vcxproj
+ RELEASE_CONFIGURATION ${RELEASE_CONF}
+ DEBUG_CONFIGURATION ${DEBUG_CONF}
+ PLATFORM ${BUILD_ARCH}
+ USE_VCPKG_INTEGRATION
+)
+
+vcpkg_copy_pdbs()
+
+# Handle copyright
+file(COPY ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/activemq-cpp)
+file(RENAME ${CURRENT_PACKAGES_DIR}/share/activemq-cpp/LICENSE.txt ${CURRENT_PACKAGES_DIR}/share/activemq-cpp/copyright)
+
+
+file(
+ COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.lib
+ DESTINATION ${CURRENT_PACKAGES_DIR}/lib
+)
+file(
+ COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.dll
+ DESTINATION ${CURRENT_PACKAGES_DIR}/bin
+)
+file(
+ COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/activemq-cpp.pdb
+ DESTINATION ${CURRENT_PACKAGES_DIR}/bin
+)
+file(
+ COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cppd.lib
+ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
+)
+file(
+ COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cppd.dll
+ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
+)
+file(
+ COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cppd.pdb
+ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
+)
+
+file(COPY ${SOURCE_PATH}/src/main/activemq DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h)
+file(COPY ${SOURCE_PATH}/src/main/cms DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h)
+file(COPY ${SOURCE_PATH}/src/main/decaf DESTINATION ${CURRENT_PACKAGES_DIR}/include FILES_MATCHING PATTERN *.h)