From 0cbccf8955b70f14bd6b2e9bd77b56da18228fa0 Mon Sep 17 00:00:00 2001
From: Louise Poubel <louise@openrobotics.org>
Date: Fri, 17 Jun 2022 13:24:12 -0700
Subject: [PATCH] Deprecate ign_add_benckmarks in favor of gz_

Signed-off-by: Louise Poubel <louise@openrobotics.org>
---
 cmake/IgnBenchmark.cmake | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/cmake/IgnBenchmark.cmake b/cmake/IgnBenchmark.cmake
index d398f807..d9da8f6e 100644
--- a/cmake/IgnBenchmark.cmake
+++ b/cmake/IgnBenchmark.cmake
@@ -7,7 +7,7 @@
 # Adds a target to generate build and system configuration information. This
 # function is private to gz-cmake.
 #
-# ign_add_benchmarks()
+# gz_add_benchmarks()
 #
 # Adds a target to execute all available benchmarks and aggregate the results.
 #
@@ -16,7 +16,7 @@
 #    include(IgnBenchmark)
 #
 # 2. Add the benchmark
-#    ign_add_benchmarks(SOURCES ${benchmark_sources_list})
+#    gz_add_benchmarks(SOURCES ${benchmark_sources_list})
 #
 # 3. After building the project, use `make run_benchmarks` to execute and
 #    aggregate benchmark results to ${CMAKE_BINARY_DIR}/benchmark_results
@@ -60,8 +60,21 @@ function(_gz_add_version_info_target)
 endfunction()
 
 function(ign_add_benchmarks)
+  # TODO(chapulina) Enable warnings after all libraries have migrated.
+  # message(WARNING "ign_add_benchmarks is deprecated, use gz_add_benchmarks instead.")
+
   cmake_parse_arguments(BENCHMARK "" "" "SOURCES" ${ARGN})
 
+  set(gz_add_benchmarks_skip_parsing true)
+  gz_add_benchmarks()
+endfunction()
+function(gz_add_benchmarks)
+
+  # Deprecated, remove skip parsing logic in version 4
+  if (NOT gz_add_benchmarks_skip_parsing)
+    cmake_parse_arguments(BENCHMARK "" "" "SOURCES" ${ARGN})
+  endif()
+
   if(NOT BUILD_TESTING)
     return()
   endif()