vcpkg/ports/faiss/portfile.cmake

44 lines
1.1 KiB
CMake
Raw Normal View History

2020-10-31 04:28:40 +08:00
vcpkg_fail_port_install(ON_ARCH "x86" ON_TARGET "uwp" "osx")
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO facebookresearch/faiss
REF 0fb6c00cfa9487416b5cdf514f5f796476eecb06 # v1.6.4
SHA512 c7019615103fd29124c1f4458a47faebc5fe35545eea185c41cf643f2eabe82d134dc558c85f67faea7680c292abd7477ceefde157a7c3969eda78b77a23462b
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()
2020-10-31 04:28:40 +08:00
vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
OPTIONS
${FEATURE_OPTIONS}
-DFAISS_ENABLE_PYTHON=OFF # Requires SWIG
)
vcpkg_install_cmake()
vcpkg_fixup_cmake_targets()
vcpkg_copy_pdbs()
file(INSTALL ${SOURCE_PATH}/LICENSE
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
RENAME copyright
)
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")