CMakeLists.txt 1.9 KB
Newer Older
J
jaime 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13
#-------------------------------------------------------------------------------
# Copyright (C) 2019-2020 Zilliz. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software distributed under the License
# is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
# or implied. See the License for the specific language governing permissions and limitations under the License.
#-------------------------------------------------------------------------------

S
sre-ci-robot 已提交
14
set( KNOWHERE_VERSION 6d26f1f )
J
jaime 已提交
15

16 17
message(STATUS "Building knowhere-${KNOWHERE_SOURCE_VER} from source")
message(STATUS ${CMAKE_BUILD_TYPE})
J
jaime 已提交
18

19
if ( BUILD_DISK_ANN STREQUAL "ON" )
P
presburger 已提交
20
    set(WITH_DISKANN ON CACHE BOOL "" FORCE )
21
else ()
P
presburger 已提交
22
    set(WITH_DISKANN OFF CACHE BOOL "" FORCE )
J
jaime 已提交
23
endif ()
24

25 26
if ( MILVUS_GPU_VERSION STREQUAL "ON" )
    set(USE_CUDA ON CACHE BOOL "" FORCE )
P
presburger 已提交
27
    set(WITH_RAFT ON CACHE BOOL "" FORCE )
28 29
endif ()

P
presburger 已提交
30

31 32 33
set( CMAKE_PREFIX_PATH ${CONAN_BOOST_ROOT} )
FetchContent_Declare(
        knowhere
P
presburger 已提交
34 35
        GIT_REPOSITORY  "https://github.com/milvus-io/knowhere.git"
        GIT_TAG         ${KNOWHERE_VERSION}
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
        SOURCE_DIR      ${CMAKE_CURRENT_BINARY_DIR}/knowhere-src
        BINARY_DIR      ${CMAKE_CURRENT_BINARY_DIR}/knowhere-build
        DOWNLOAD_DIR    ${THIRDPARTY_DOWNLOAD_PATH} )

FetchContent_GetProperties( knowhere )
if ( NOT knowhere_POPULATED )
    FetchContent_Populate( knowhere )

    # Adding the following target:
    # knowhere
    add_subdirectory( ${knowhere_SOURCE_DIR}
                      ${knowhere_BINARY_DIR} )
endif()

# get prometheus COMPILE_OPTIONS
get_property( var DIRECTORY "${knowhere_SOURCE_DIR}" PROPERTY COMPILE_OPTIONS )
message( STATUS "knowhere src compile options: ${var}" )