From f00a681652da60b79178de2109fa707094cb65f5 Mon Sep 17 00:00:00 2001 From: smathis Date: Wed, 8 Jul 2026 08:50:39 +0200 Subject: [PATCH] Added header guards for CMake add_subdirectory --- CMakeLists.txt | 11 +++++------ lan_gpib_vxi11 | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 67a64ae..f1623ff 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.03) project(midas_lan_gpib VERSION 0.1) -# If the target already exists in a project (e.g. if midas_lan_gpib is included multiple time as a submodule of submodules), +# If the target already exists in a project (e.g. if lan_gpib_vxi11_linux_64bit is included multiple time as a submodule of submodules), # this "header guard"-style check prevents defining the same target multiple times (which will lead to CMake errors). if(TARGET midas_lan_gpib) return() @@ -25,11 +25,6 @@ set( $ENV{MIDASSYS}/drivers/class/generic.cxx ) -# guard against multiple include -if(NOT TARGET lan_gpib_vxi11_linux_64bit) - add_subdirectory(lan_gpib_vxi11) -endif() - set(SYS_LIBS pthread util @@ -45,6 +40,10 @@ set(MIDAS_LIBS set(LIBS ${SYS_LIBS} ${MIDAS_LIBS}) +if(NOT TARGET lan_gpib_vxi11_linux_64bit) + add_subdirectory(lan_gpib_vxi11) +endif() + ################################################################################ ## Bus library ################################################################################ diff --git a/lan_gpib_vxi11 b/lan_gpib_vxi11 index 59562b0..04a5865 160000 --- a/lan_gpib_vxi11 +++ b/lan_gpib_vxi11 @@ -1 +1 @@ -Subproject commit 59562b001d005eba0f2ed153cbe021c42b3ccc50 +Subproject commit 04a5865598991359b3e0a2de1d0c4470b945b271