Skip to content

Commit

Permalink
[bloomberg-quantum] add new port (microsoft#34682)
Browse files Browse the repository at this point in the history
* [quantum] add new port

* fix deps

* [bloomberg-quantum]:not work now

* [quantum] add new port

* [quantum] add new port

* [quantum] add new port

* fix deps

* rename config file
  • Loading branch information
jiayuehua authored Oct 28, 2023
1 parent ab567f8 commit 2b1fd46
Show file tree
Hide file tree
Showing 5 changed files with 99 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ports/bloomberg-quantum/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO bloomberg/quantum
REF f4b872f99480bc7f2ab60620d99823e8f2d3b0d6
SHA512 c41930c8bb0a1b70fdd4123ef349a0e8e892e0ecd52b412a171b1ce05386323a9ed2376a792ac12cd69f7d5a97a257bc08c2b85ce8a5f16b6f4e75740823b53b
HEAD_REF master
PATCHES rename-config-file-and-namespace.patch
)

set(VCPKG_BUILD_TYPE release) # header-only

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DQUANTUM_EXPORT_PKGCONFIG=OFF
)

vcpkg_cmake_install()

vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-${PORT} CONFIG_PATH "share/cmake/unofficial-${PORT}")

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
46 changes: 46 additions & 0 deletions ports/bloomberg-quantum/rename-config-file-and-namespace.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d22f0f..55d6f65 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -33,8 +33,9 @@ endif()
if (NOT QUANTUM_PKGCONFIG_DIR)
set(QUANTUM_PKGCONFIG_DIR share/pkgconfig)
endif()
+set(PROJECT_NAMESPACE_NAME unofficial-bloomberg-${PROJECT_NAME})
if (NOT QUANTUM_CMAKE_CONFIG_DIR)
- set(QUANTUM_CMAKE_CONFIG_DIR share/cmake/${PROJECT_NAME})
+ set(QUANTUM_CMAKE_CONFIG_DIR share/cmake/${PROJECT_NAMESPACE_NAME})
endif()

#Global options
diff --git a/cmake/QuantumConfig.cmake.in b/cmake/unofficial-bloomberg-QuantumConfig.cmake.in
similarity index 100%
rename from cmake/QuantumConfig.cmake.in
rename to cmake/unofficial-bloomberg-QuantumConfig.cmake.in
diff --git a/quantum/CMakeLists.txt b/quantum/CMakeLists.txt
index 1a721f9..1e93bc4 100644
--- a/quantum/CMakeLists.txt
+++ b/quantum/CMakeLists.txt
@@ -21,10 +21,10 @@ make_quantum_header()

set(PKG_DIR "${CMAKE_BINARY_DIR}/package")
set(PKGCONFIG_FILE "${PKG_DIR}/${PROJECT_TARGET_NAME}.pc")
-set(TARGET_CONFIG_FILE "${PKG_DIR}/${PROJECT_NAME}Config.cmake")
-set(TARGET_VERSION_FILE "${PKG_DIR}/${PROJECT_NAME}ConfigVersion.cmake")
+set(TARGET_CONFIG_FILE "${PKG_DIR}/${PROJECT_NAMESPACE_NAME}Config.cmake")
+set(TARGET_VERSION_FILE "${PKG_DIR}/${PROJECT_NAMESPACE_NAME}ConfigVersion.cmake")
set(TARGET_EXPORT_NAME ${PROJECT_NAME}Targets)
-set(NAMESPACE "${PROJECT_NAME}::")
+set(NAMESPACE "${PROJECT_NAMESPACE_NAME}::")

add_library(${PROJECT_TARGET_NAME} INTERFACE)
set(QUANTUM_DEPENDENCIES Boost::context pthread)
@@ -70,7 +70,7 @@ if (QUANTUM_EXPORT_CMAKE_CONFIG)

# Generate CMAKE configuration file and exported targets
configure_package_config_file(
- "${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAME}Config.cmake.in"
+ "${PROJECT_SOURCE_DIR}/cmake/${PROJECT_NAMESPACE_NAME}Config.cmake.in"
"${TARGET_CONFIG_FILE}"
INSTALL_DESTINATION "${QUANTUM_CMAKE_CONFIG_DIR}"
PATH_VARS CMAKE_INSTALL_PREFIX CMAKE_INSTALL_INCLUDEDIR
18 changes: 18 additions & 0 deletions ports/bloomberg-quantum/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "bloomberg-quantum",
"version-date": "2023-02-03",
"description": "Powerful multi-threaded coroutine dispatcher and parallel execution engine",
"homepage": "https://github.com/bloomberg/quantum/",
"license": "Apache-2.0",
"dependencies": [
"boost-context",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
9 changes: 9 additions & 0 deletions versions/b-/bloomberg-quantum.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "9099d9be8e575f44a311cf7d5032ee5c9dcdc82f",
"version-date": "2023-02-03",
"port-version": 0
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,10 @@
"baseline": "2020-03-25",
"port-version": 5
},
"bloomberg-quantum": {
"baseline": "2023-02-03",
"port-version": 0
},
"blosc": {
"baseline": "1.21.5",
"port-version": 0
Expand Down

0 comments on commit 2b1fd46

Please sign in to comment.