mirror of
https://gitee.com/milvus-io/milvus.git
synced 2026-01-04 09:52:30 +08:00
58 lines
2.4 KiB
CMake
58 lines
2.4 KiB
CMake
#-------------------------------------------------------------------------------
|
|
# 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.
|
|
#-------------------------------------------------------------------------------
|
|
|
|
if (DEFINED ENV{MILVUS_PULSAR_URL})
|
|
set(PULSAR_URL "$ENV{MILVUS_PULSAR_URL}")
|
|
else ()
|
|
set(PULSAR_URL
|
|
"https://github.com/apache/pulsar/archive/${PULSAR_CLIENT_CPP_VERSION}.zip")
|
|
endif ()
|
|
|
|
message(STATUS "Building pulsar-client-cpp-${PULSAR_CLIENT_CPP_VERSION} from source")
|
|
|
|
include(ExternalProject)
|
|
ExternalProject_Add(
|
|
pulsar
|
|
URL ${PULSAR_URL}
|
|
PREFIX ${pulsar_ROOT}
|
|
CONFIGURE_COMMAND cd ${pulsar_ROOT}/src/pulsar/pulsar-client-cpp && cmake -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=${pulsar_ROOT}/build .
|
|
BUILD_COMMAND cd ${pulsar_ROOT}/src/pulsar/pulsar-client-cpp && make -j8
|
|
BUILD_IN_SOURCE true
|
|
INSTALL_COMMAND cd ${pulsar_ROOT}/src/pulsar/pulsar-client-cpp && make install
|
|
)
|
|
#FetchContent_Declare(
|
|
# pulsar
|
|
# URL ${PULSAR_URL}
|
|
# # URL_MD5 "f9137c5bc18b7d74027936f0f1bfa5c8"
|
|
# DOWNLOAD_DIR ${MILVUS_BINARY_DIR}/3rdparty_download/download
|
|
# SOURCE_DIR ${CMAKE_CURRENT_BINARY_DIR}/pulsar-client-cpp-src
|
|
# BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/pulsar-client-cpp-build
|
|
#)
|
|
#
|
|
#include(FetchContent)
|
|
#FetchContent_GetProperties( pulsar )
|
|
#SET(BUILD_TESTS CACHE BOOL OFF FORCE)
|
|
#if (NOT pulsar_POPULATED)
|
|
# FetchContent_Populate(pulsar)
|
|
#
|
|
# # Adding the following targets:
|
|
# # pulsar-client-cpp
|
|
# add_subdirectory(${pulsar_SOURCE_DIR}/pulsar-client-cpp
|
|
# ${pulsar_BINARY_DIR}/pulsar-client-cpp
|
|
# EXCLUDE_FROM_ALL)
|
|
#endif ()
|
|
#
|
|
#include_directories(${pulsar_SOURCE_DIR}/pulsar-client-cpp/include)
|
|
#get_property(var DIRECTORY "${pulsar_SOURCE_DIR}/pulsar-client-cpp" PROPERTY COMPILE_OPTIONS)
|
|
#message(STATUS "pulsar-client-cpp compile options: ${var}")
|