diff --git a/ports/activemq-cpp/CONTROL b/ports/activemq-cpp/CONTROL
index 85a7cff7d3..3d06d97151 100644
--- a/ports/activemq-cpp/CONTROL
+++ b/ports/activemq-cpp/CONTROL
@@ -1,5 +1,5 @@
Source: activemq-cpp
-Version: 3.9.5-2
+Version: 3.9.5-3
Build-Depends: apr
Description: Apache ActiveMQ is the most popular and powerful open source messaging and Integration Patterns server.
Supports: !(uwp|linux|osx)
diff --git a/ports/activemq-cpp/fix-crt-linkage.patch b/ports/activemq-cpp/fix-crt-linkage.patch
new file mode 100644
index 0000000000..fcb74fda7a
--- /dev/null
+++ b/ports/activemq-cpp/fix-crt-linkage.patch
@@ -0,0 +1,36 @@
+diff --git a/vs2010-build/activemq-cpp.vcxproj b/vs2010-build/activemq-cpp.vcxproj
+index 54b4822..6b35511 100644
+--- a/vs2010-build/activemq-cpp.vcxproj
++++ b/vs2010-build/activemq-cpp.vcxproj
+@@ -2578,6 +2578,7 @@
+ Default
+ true
+ false
++ MultiThreadedDebug
+ true
+
+
+@@ -2687,6 +2688,7 @@
+ true
+ false
+ true
++ MultiThreadedDebug
+
+
+
+@@ -2794,6 +2796,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ true
++ MultiThreaded
+
+
+
+@@ -2906,6 +2909,7 @@
+ ../src/main;$(APR_DIST)\$(PlatformName)\include;$(OPENSSL_DIST)\$(PlatformName)\include;$(PLATFORM_SDK)\include;%(AdditionalIncludeDirectories)
+ false
+ true
++ MultiThreaded
+
+
+
diff --git a/ports/activemq-cpp/portfile.cmake b/ports/activemq-cpp/portfile.cmake
index 1b83fd1e31..6afa95b791 100644
--- a/ports/activemq-cpp/portfile.cmake
+++ b/ports/activemq-cpp/portfile.cmake
@@ -11,11 +11,30 @@ vcpkg_download_distfile(ARCHIVE
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE ${ARCHIVE}
- PATCHES ${CMAKE_CURRENT_LIST_DIR}/FunctionLevelLinkingOn.diff
+ PATCHES
+ FunctionLevelLinkingOn.diff
+ fix-crt-linkage.patch
)
-set(RELEASE_CONF "ReleaseDLL")
-set(DEBUG_CONF "DebugDLL")
+set(ACTIVEMQCPP_MSVC_PROJ ${SOURCE_PATH}/vs2010-build/activemq-cpp.vcxproj)
+
+string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" ACTIVEMQCPP_SHARED_LIB)
+
+if (ACTIVEMQCPP_SHARED_LIB)
+ set(RELEASE_CONF "ReleaseDLL")
+ set(DEBUG_CONF "DebugDLL")
+
+ set(ACTIVEMQCPP_LIB_PREFFIX )
+ set(ACTIVEMQCPP_LIB_SUFFIX d)
+ vcpkg_replace_string(${ACTIVEMQCPP_MSVC_PROJ} ";apr-1.lib" ";libapr-1.lib")
+else()
+ set(RELEASE_CONF "Release")
+ set(DEBUG_CONF "Debug")
+
+ set(ACTIVEMQCPP_LIB_PREFFIX lib)
+ set(ACTIVEMQCPP_LIB_SUFFIX )
+ vcpkg_replace_string(${ACTIVEMQCPP_MSVC_PROJ} ";libapr-1.lib" ";apr-1.lib")
+endif()
if (VCPKG_TARGET_ARCHITECTURE MATCHES "x86")
set(BUILD_ARCH "Win32")
@@ -27,9 +46,8 @@ else()
message(FATAL_ERROR "Unsupported architecture: ${VCPKG_TARGET_ARCHITECTURE}")
endif()
-
vcpkg_build_msbuild(
- PROJECT_PATH ${SOURCE_PATH}/vs2010-build/activemq-cpp.vcxproj
+ PROJECT_PATH ${ACTIVEMQCPP_MSVC_PROJ}
RELEASE_CONFIGURATION ${RELEASE_CONF}
DEBUG_CONFIGURATION ${DEBUG_CONF}
PLATFORM ${BUILD_ARCH}
@@ -38,39 +56,44 @@ vcpkg_build_msbuild(
vcpkg_copy_pdbs()
-file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
+if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
+ file(COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${RELEASE_CONF}/${ACTIVEMQCPP_LIB_PREFFIX}activemq-cpp.lib
+ DESTINATION ${CURRENT_PACKAGES_DIR}/lib
+ )
+
+ if (ACTIVEMQCPP_SHARED_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
+ )
+ endif()
+endif()
-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
-)
+if (NOT VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
+ file(COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/${ACTIVEMQCPP_LIB_PREFFIX}activemq-cpp${ACTIVEMQCPP_LIB_SUFFIX}.lib
+ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/lib
+ )
+
+ if (ACTIVEMQCPP_SHARED_LIB)
+ file(COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cpp${ACTIVEMQCPP_LIB_SUFFIX}.dll
+ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
+ )
+ file(COPY
+ ${SOURCE_PATH}/vs2010-build/${BUILD_ARCH}/${DEBUG_CONF}/activemq-cpp${ACTIVEMQCPP_LIB_SUFFIX}.pdb
+ DESTINATION ${CURRENT_PACKAGES_DIR}/debug/bin
+ )
+ endif()
+endif()
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)
+
+file(INSTALL ${SOURCE_PATH}/LICENSE.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
diff --git a/scripts/ci.baseline.txt b/scripts/ci.baseline.txt
index 6a1415c2da..587823f41c 100644
--- a/scripts/ci.baseline.txt
+++ b/scripts/ci.baseline.txt
@@ -44,7 +44,6 @@
7zip:x64-linux=fail
7zip:x64-osx=fail
7zip:x64-uwp=fail
-activemq-cpp:x64-windows-static=fail
activemq-cpp:x64-linux=fail
activemq-cpp:x64-osx=fail
akali:x64-uwp=fail