From a5d0b551de2f3af69a8e91019ca2041e26e96915 Mon Sep 17 00:00:00 2001
From: jmcarcell <jmcarcell@users.noreply.github.com>
Date: Tue, 17 Oct 2023 21:51:07 +0200
Subject: [PATCH] Check if the tests target exists before creating it

---
 streamlog/examples/CMakeLists.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/streamlog/examples/CMakeLists.txt b/streamlog/examples/CMakeLists.txt
index c3d0b50..ca0b94c 100644
--- a/streamlog/examples/CMakeLists.txt
+++ b/streamlog/examples/CMakeLists.txt
@@ -13,7 +13,9 @@ SET( test_bins test_log)
 ADD_SHARED_LIBRARY( streamlog_test EXCLUDE_FROM_ALL fibonacci.cc  )
 
 # create symbolic bin target
-ADD_CUSTOM_TARGET( tests )
+if (NOT TARGET tests)
+  ADD_CUSTOM_TARGET( tests )
+endif()
 
 # loop through list of test binaries
 FOREACH( bin ${test_bins} )
-- 
GitLab