From 7a9a0ff2cff63ee6ee9137481a79bbba4bbc9ac8 Mon Sep 17 00:00:00 2001 From: xiaozhuai <798047000@qq.com> Date: Thu, 11 Jun 2026 21:36:43 +0800 Subject: [PATCH] [numactl] Add cmake config --- ports/numactl/portfile.cmake | 2 ++ ports/numactl/unofficial-numa-config.cmake | 27 ++++++++++++++++++++++ ports/numactl/vcpkg.json | 2 +- versions/baseline.json | 2 +- versions/n-/numactl.json | 5 ++++ 5 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 ports/numactl/unofficial-numa-config.cmake diff --git a/ports/numactl/portfile.cmake b/ports/numactl/portfile.cmake index 27268ad1ad..22658d9c0c 100644 --- a/ports/numactl/portfile.cmake +++ b/ports/numactl/portfile.cmake @@ -15,6 +15,8 @@ vcpkg_make_configure( vcpkg_make_install() vcpkg_fixup_pkgconfig() +file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/unofficial-numa-config.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/unofficial-numa") + file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include" "${CURRENT_PACKAGES_DIR}/debug/share") vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/README.md" "${SOURCE_PATH}/LICENSE.LGPL2.1" "${SOURCE_PATH}/LICENSE.GPL2") diff --git a/ports/numactl/unofficial-numa-config.cmake b/ports/numactl/unofficial-numa-config.cmake new file mode 100644 index 0000000000..d3b664a58c --- /dev/null +++ b/ports/numactl/unofficial-numa-config.cmake @@ -0,0 +1,27 @@ +if(NOT TARGET unofficial::numa::numa) + add_library(unofficial::numa::numa UNKNOWN IMPORTED) + + get_filename_component(Z_VCPKG_NUMA_ROOT "${CMAKE_CURRENT_LIST_DIR}/../.." ABSOLUTE) + + find_library(Z_VCPKG_NUMA_LIBRARY_RELEASE NAMES numa PATHS "${Z_VCPKG_NUMA_ROOT}/lib" NO_DEFAULT_PATH REQUIRED) + find_library(Z_VCPKG_NUMA_LIBRARY_DEBUG NAMES numa PATHS "${Z_VCPKG_NUMA_ROOT}/debug/lib" NO_DEFAULT_PATH) + + if(Z_VCPKG_NUMA_LIBRARY_DEBUG) + set_target_properties(unofficial::numa::numa PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${Z_VCPKG_NUMA_ROOT}/include" + IMPORTED_CONFIGURATIONS "Debug;Release" + IMPORTED_LOCATION_DEBUG "${Z_VCPKG_NUMA_LIBRARY_DEBUG}" + IMPORTED_LOCATION_RELEASE "${Z_VCPKG_NUMA_LIBRARY_RELEASE}" + ) + else() + set_target_properties(unofficial::numa::numa PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${Z_VCPKG_NUMA_ROOT}/include" + IMPORTED_CONFIGURATIONS "Release" + IMPORTED_LOCATION_RELEASE "${Z_VCPKG_NUMA_LIBRARY_RELEASE}" + ) + endif() + + unset(Z_VCPKG_NUMA_ROOT) + unset(Z_VCPKG_NUMA_LIBRARY_RELEASE) + unset(Z_VCPKG_NUMA_LIBRARY_DEBUG) +endif() diff --git a/ports/numactl/vcpkg.json b/ports/numactl/vcpkg.json index 2ae679d11a..12e834a281 100644 --- a/ports/numactl/vcpkg.json +++ b/ports/numactl/vcpkg.json @@ -1,7 +1,7 @@ { "name": "numactl", "version": "2.0.19", - "port-version": 1, + "port-version": 2, "description": "NUMA support for Linux", "homepage": "https://github.com/numactl/numactl", "license": null, diff --git a/versions/baseline.json b/versions/baseline.json index 2fe3c21851..2212395f3f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -7150,7 +7150,7 @@ }, "numactl": { "baseline": "2.0.19", - "port-version": 1 + "port-version": 2 }, "numcpp": { "baseline": "2.16.1", diff --git a/versions/n-/numactl.json b/versions/n-/numactl.json index 758deba320..830998d54d 100644 --- a/versions/n-/numactl.json +++ b/versions/n-/numactl.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "8eab057e0900e2c82cca626446a7f9b50ce3c068", + "version": "2.0.19", + "port-version": 2 + }, { "git-tree": "319c15f35bf84f9e0c3c2ed8d3a0aa84d1c5cd41", "version": "2.0.19",