faiss/CMakeLists.txt
Mo Zhou 1ac4ef5b77 CMake: use GNUInstallDirs instead of hardcoded paths. (#1541)
Summary:
Upstreamed from Debian packaging: https://salsa.debian.org/deeplearning-team/faiss

Pull Request resolved: https://github.com/facebookresearch/faiss/pull/1541

Reviewed By: mdouze

Differential Revision: D25175035

Pulled By: beauby

fbshipit-source-id: c6bc5896e2b602e49edc4bf6ccc8cf97df25ad85
2020-11-24 23:10:06 -08:00

52 lines
1.3 KiB
CMake

# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
project(faiss
VERSION 1.6.4
DESCRIPTION "A library for efficient similarity search and clustering of dense vectors."
HOMEPAGE_URL "https://github.com/facebookresearch/faiss"
LANGUAGES CXX)
include(GNUInstallDirs)
set(CMAKE_CXX_STANDARD 11)
list(APPEND CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake")
# Valid values are "generic", "sse4", "avx2".
option(FAISS_OPT_LEVEL "" "generic")
option(FAISS_ENABLE_GPU "Enable support for GPU indexes." ON)
option(FAISS_ENABLE_PYTHON "Build Python extension." ON)
if(FAISS_ENABLE_GPU)
set(CMAKE_CUDA_HOST_COMPILER ${CMAKE_CXX_COMPILER})
enable_language(CUDA)
endif()
add_subdirectory(faiss)
if(FAISS_ENABLE_GPU)
add_subdirectory(faiss/gpu)
endif()
if(FAISS_ENABLE_PYTHON)
add_subdirectory(faiss/python)
endif()
add_subdirectory(demos)
add_subdirectory(tutorial/cpp)
# CTest must be included in the top level to enable `make test` target.
include(CTest)
if(BUILD_TESTING)
add_subdirectory(tests)
if(FAISS_ENABLE_GPU)
add_subdirectory(faiss/gpu/test)
endif()
endif()