From f0873f85ff046c6dee35a85148a51bfab73af44a Mon Sep 17 00:00:00 2001 From: Niklas Uhl Date: Thu, 30 Nov 2023 15:33:31 +0100 Subject: [PATCH] Add include guard for kassert target. (#49) --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c25343..0ccdffd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,11 @@ project( LANGUAGES CXX ) +# include guard to prevent duplicate targets when including this project as a subdirectory +if (TARGET kassert) + return() +endif () + if (CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) # folder support for IDEs set_property(GLOBAL PROPERTY USE_FOLDERS ON)