[blpapi] add new port (#32603)

* [blpapi] add new port

* Deduplicate common prefixes, and better handle release-only triplets.

---------

Co-authored-by: Billy Robert O'Neal III <bion@microsoft.com>
This commit is contained in:
Jonathan Sweemer 2023-07-26 04:20:51 +09:00 committed by GitHub
parent 080bf4d78f
commit 250209efbb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 130 additions and 0 deletions

View File

@ -0,0 +1,60 @@
# According to Bloomberg Helpdesk on 2023-07-18, the last digit of the version string is just a build identifier,
# not an actual version identifier, and can be different between the latest Linux and Windows distfiles.
if (VCPKG_TARGET_IS_LINUX)
vcpkg_download_distfile(ARCHIVE
URLS "https://bcms.bloomberg.com/BLPAPI-Generic/blpapi_cpp_3.20.2.1-linux.tar.gz"
FILENAME "blpapi_cpp_3.20.2.1-linux.tar.gz"
SHA512 4d4cf999d6cc2bf924dfb79fdabd2a30c2d1251e4e56fe856684c4f8e0be03dcd33f69d75f8706d381bb35ad4b1ad954a5cc88156a80e053f2601d8257815863
)
elseif (VCPKG_TARGET_IS_WINDOWS)
vcpkg_download_distfile(ARCHIVE
URLS "https://bcms.bloomberg.com/BLPAPI-Generic/blpapi_cpp_3.20.2.2-windows.zip"
FILENAME "blpapi_cpp_3.20.2.2-windows.zip"
SHA512 f6e66d75a8f16c014737ae813c65304e38423e5ab955eb98fb7f487eecda06bcc9d84733b55957ac577f689da2af753fdeb132feb0eb02a9ec38e8f3868ad795
)
endif()
vcpkg_extract_source_archive(
SOURCE_PATH
ARCHIVE "${ARCHIVE}"
PATCHES update-blpapi-lib-include-dir.patch
)
if ("${VCPKG_TARGET_ARCHITECTURE}" MATCHES "x86")
set(BITS_SUFFIX 32)
elseif ("${VCPKG_TARGET_ARCHITECTURE}" MATCHES "x64")
set(BITS_SUFFIX 64)
else()
message(FATAL_ERROR "Unrecognized architecture.")
endif()
if (VCPKG_TARGET_IS_LINUX)
file(GLOB SO_FILES LIST_DIRECTORIES false "${SOURCE_PATH}/Linux/*${BITS_SUFFIX}.so")
else()
file(GLOB DLL_FILES LIST_DIRECTORIES false "${SOURCE_PATH}/lib/*${BITS_SUFFIX}.dll")
file(GLOB LIB_FILES LIST_DIRECTORIES false "${SOURCE_PATH}/lib/*${BITS_SUFFIX}.lib")
endif()
if (VCPKG_TARGET_IS_LINUX)
file(COPY ${SO_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
if (NOT VCPKG_BUILD_TYPE)
file(COPY ${SO_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()
else()
file(COPY ${DLL_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/bin")
file(COPY ${LIB_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/lib")
if (NOT VCPKG_BUILD_TYPE)
file(COPY ${DLL_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/bin")
file(COPY ${LIB_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/debug/lib")
endif()
endif()
file(COPY "${SOURCE_PATH}/include" DESTINATION "${CURRENT_PACKAGES_DIR}")
file(GLOB CMAKE_FILES LIST_DIRECTORIES false "${SOURCE_PATH}/cmake/*.cmake")
file(COPY ${CMAKE_FILES} DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" @ONLY)
file(INSTALL "${SOURCE_PATH}/License.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@ -0,0 +1,46 @@
diff --git a/cmake/blpapiTargets-release.cmake b/cmake/blpapiTargets-release.cmake
index 12bcaa6..af5c135 100644
--- a/cmake/blpapiTargets-release.cmake
+++ b/cmake/blpapiTargets-release.cmake
@@ -5,21 +5,18 @@
# Import targets for configuration "Release".
# Path to blpapi shared object in relation to blpapiConfig.cmake:
-# 1. On Windows
-# a. For release ../lib/
-# 2. On other platforms
-# a. For release ../<SystemName>/. For example for linux it is ../Linux/
+# 1. For release ../../lib/
# Windows
if(WIN32)
set(_BLPAPI_SHARED_OBJ_NAME "${_BLPAPI_PREFIX}_${_ARCH}.dll")
set(_BLPAPI_SHARED_IMP_OBJ_NAME "${_BLPAPI_PREFIX}_${_ARCH}.lib")
- set(_BLPAPI_SHARED_OBJ "${_BLPAPI_CONFIG_CMAKE_DIR}/../lib/${_BLPAPI_SHARED_OBJ_NAME}")
- set(_BLPAPI_IMP_OBJ "${_BLPAPI_CONFIG_CMAKE_DIR}/../lib/${_BLPAPI_SHARED_IMP_OBJ_NAME}")
+ set(_BLPAPI_SHARED_OBJ "${_BLPAPI_CONFIG_CMAKE_DIR}/../../bin/${_BLPAPI_SHARED_OBJ_NAME}")
+ set(_BLPAPI_IMP_OBJ "${_BLPAPI_CONFIG_CMAKE_DIR}/../../lib/${_BLPAPI_SHARED_IMP_OBJ_NAME}")
else() # Other platforms
set(_BLPAPI_SHARED_OBJ_NAME "lib${_BLPAPI_PREFIX}_${_ARCH}.so")
set(_BLPAPI_SHARED_OBJ
- "${_BLPAPI_CONFIG_CMAKE_DIR}/../${CMAKE_SYSTEM_NAME}/${_BLPAPI_SHARED_OBJ_NAME}")
+ "${_BLPAPI_CONFIG_CMAKE_DIR}/../../lib/${_BLPAPI_SHARED_OBJ_NAME}")
endif()
set_property(TARGET blpapi APPEND PROPERTY IMPORTED_LOCATION "${_BLPAPI_SHARED_OBJ}")
diff --git a/cmake/blpapiTargets.cmake b/cmake/blpapiTargets.cmake
index b4c4a73..ef4421c 100644
--- a/cmake/blpapiTargets.cmake
+++ b/cmake/blpapiTargets.cmake
@@ -47,9 +47,9 @@ unset(_expectedTargets)
# Create imported shared object target blpapi.
add_library(blpapi SHARED IMPORTED)
-# Include headers can be found at ../include/ from location
+# Include headers can be found at ../../include/ from location
# of blpapiConfig.cmake file.
-set(_BLPAPI_LIB_INCLUDE_DIR "${_BLPAPI_CONFIG_CMAKE_DIR}/../include")
+set(_BLPAPI_LIB_INCLUDE_DIR "${_BLPAPI_CONFIG_CMAKE_DIR}/../../include")
# Add path to the include directories.
set_property(TARGET blpapi APPEND PROPERTY

4
ports/blpapi/usage Normal file
View File

@ -0,0 +1,4 @@
The package blpapi provides CMake targets:
find_package(blpapi CONFIG REQUIRED)
target_link_libraries(main PRIVATE blpapi)

7
ports/blpapi/vcpkg.json Normal file
View File

@ -0,0 +1,7 @@
{
"name": "blpapi",
"version": "3.20.2",
"description": "Bloomberg API Library (BLPAPI)",
"homepage": "https://www.bloomberg.com/professional/support/api-library/",
"supports": "(linux | (windows & !uwp)) & !static & (x86 | x64)"
}

9
versions/b-/blpapi.json Normal file
View File

@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "78171a41201cdb236d95e50ed26f6b76675f97de",
"version": "3.20.2",
"port-version": 0
}
]
}

View File

@ -624,6 +624,10 @@
"baseline": "1.21.3",
"port-version": 0
},
"blpapi": {
"baseline": "3.20.2",
"port-version": 0
},
"boinc": {
"baseline": "7.22.2",
"port-version": 2