From 7682ee4f049a02aa8bb1fbd4c89f71ce98a77921 Mon Sep 17 00:00:00 2001 From: Vyas Ramasubramani Date: Tue, 25 Oct 2022 16:53:46 -0700 Subject: [PATCH] Switch to using rapids-cmake for gbench. (#954) Switch to using a centralized rapids-cmake function for getting Google benchmark. Authors: - Vyas Ramasubramani (https://github.com/vyasr) Approvers: - Corey J. Nolet (https://github.com/cjnolet) URL: https://github.com/rapidsai/raft/pull/954 --- cpp/CMakeLists.txt | 3 +- cpp/cmake/thirdparty/get_gbench.cmake | 43 --------------------------- 2 files changed, 2 insertions(+), 44 deletions(-) delete mode 100644 cpp/cmake/thirdparty/get_gbench.cmake diff --git a/cpp/CMakeLists.txt b/cpp/CMakeLists.txt index 58006d69e7..3998a7c024 100644 --- a/cpp/CMakeLists.txt +++ b/cpp/CMakeLists.txt @@ -167,7 +167,8 @@ if(BUILD_TESTS) endif() if(BUILD_BENCH) - include(cmake/thirdparty/get_gbench.cmake) + include(${rapids-cmake-dir}/cpm/gbench.cmake) + rapids_cpm_gbench() endif() ############################################################################## diff --git a/cpp/cmake/thirdparty/get_gbench.cmake b/cpp/cmake/thirdparty/get_gbench.cmake deleted file mode 100644 index a3d5678f74..0000000000 --- a/cpp/cmake/thirdparty/get_gbench.cmake +++ /dev/null @@ -1,43 +0,0 @@ -#============================================================================= -# Copyright (c) 2022, NVIDIA CORPORATION. -# -# 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. -#============================================================================= - -function(find_and_configure_gbench) - - set(oneValueArgs VERSION PINNED_TAG) - cmake_parse_arguments(PKG "${options}" "${oneValueArgs}" - "${multiValueArgs}" ${ARGN} ) - - rapids_cpm_find(benchmark ${PKG_VERSION} - GLOBAL_TARGETS benchmark::benchmark - CPM_ARGS - GIT_REPOSITORY https://github.com/google/benchmark.git - GIT_TAG ${PKG_PINNED_TAG} - OPTIONS - "BENCHMARK_ENABLE_GTEST_TESTS OFF" - "BENCHMARK_ENABLE_TESTING OFF" - "BENCHMARK_ENABLE_INSTALL OFF" - "CMAKE_BUILD_TYPE Release" - "CMAKE_INSTALL_LIBDIR lib" - ) - - if(NOT TARGET benchmark::benchmark) - add_library(benchmark::benchmark ALIAS benchmark) - endif() - -endfunction() - -find_and_configure_gbench(VERSION 1.5.3 - PINNED_TAG c05843a9f622db08ad59804c190f98879b76beba)