From a7167c86036c63b72132c9beaa1c7accf4eb2c00 Mon Sep 17 00:00:00 2001 From: Chris Thrasher Date: Tue, 18 Feb 2025 11:48:11 -0700 Subject: [PATCH] Exit early if `UDev::UDev` target already exists This prevents a potential error where two projects in a larger build graph depend on UDev and both attempt to create the same target. --- cmake/Modules/FindUDev.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/Modules/FindUDev.cmake b/cmake/Modules/FindUDev.cmake index d4fb21339..5acd55e66 100644 --- a/cmake/Modules/FindUDev.cmake +++ b/cmake/Modules/FindUDev.cmake @@ -9,6 +9,10 @@ # Redistribution and use of this file is allowed according to the terms of the BSD license. # +if(TARGET UDev::UDev) + return() +endif() + find_path( UDEV_INCLUDE_DIR libudev.h