vcpkg/ports/faiss/portfile.cmake

39 lines
1.0 KiB
CMake
Raw Normal View History

2020-10-31 04:28:40 +08:00
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebookresearch/faiss
2024-10-29 17:27:05 +08:00
REF "v${VERSION}"
SHA512 38d4215e3e019915d8b367ff0e8d14901b1495f6f45b835e9248276567a422b0370baab6bd887045442dd1e268b7fe7c347107162e66bb3ec6b1a53be4b2e441
2020-10-31 04:28:40 +08:00
HEAD_REF master
PATCHES
fix-dependencies.patch
2020-10-31 04:28:40 +08:00
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
gpu FAISS_ENABLE_GPU
2020-10-31 04:28:40 +08:00
)
if ("${FAISS_ENABLE_GPU}")
if (NOT VCPKG_CMAKE_SYSTEM_NAME AND NOT ENV{CUDACXX})
set(ENV{CUDACXX} "$ENV{CUDA_PATH}/bin/nvcc.exe")
endif()
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
2020-10-31 04:28:40 +08:00
OPTIONS
${FEATURE_OPTIONS}
-DFAISS_ENABLE_PYTHON=OFF # Requires SWIG
-DBUILD_TESTING=OFF
2020-10-31 04:28:40 +08:00
)
vcpkg_cmake_install()
2020-10-31 04:28:40 +08:00
vcpkg_cmake_config_fixup()
2020-10-31 04:28:40 +08:00
vcpkg_copy_pdbs()
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
2020-10-31 04:28:40 +08:00
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")