From ff4d002822cabd049494e6592876b516fa7a4ab0 Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Thu, 13 Mar 2025 13:20:26 +0100
Subject: [PATCH 1/3] Fixes to dependencies on CbmYamlInterface and related
 include folders definition

- Declare CbmYamlInterface as INTERFACE dependency where needed (instead of PRIVATE/PUBLIC if already in)
- Add include folders for algo/yaml and algo/qa where needed
- Replace all occurences of CBMROOT_SOURCE_DIR in include folders definition with CMAKE_SOURCE_DIR
---
 algo/CMakeLists.txt                | 8 ++++----
 core/qa/CMakeLists.txt             | 2 ++
 reco/KF/KFParticleInterface.cmake  | 8 +++++---
 reco/L1/CMakeLists.txt             | 5 +++++
 reco/detectors/tof/CMakeLists.txt  | 2 +-
 reco/tasks/CMakeLists.txt          | 4 +++-
 reco/tasks/CbmTaskDigiEventQa.cxx  | 2 +-
 sim/transport/steer/CMakeLists.txt | 2 +-
 8 files changed, 22 insertions(+), 11 deletions(-)

diff --git a/algo/CMakeLists.txt b/algo/CMakeLists.txt
index 89640eefdc..677b09d719 100644
--- a/algo/CMakeLists.txt
+++ b/algo/CMakeLists.txt
@@ -217,7 +217,6 @@ target_include_directories(Algo
 
 target_link_libraries(Algo
   PUBLIC    OnlineData
-            CbmYamlInterface
             KfCore
             CaCore
             ROOT::GenVector
@@ -234,7 +233,8 @@ target_link_libraries(Algo
             external::fles_monitoring
             cppzmq
             poolstl
-  PRIVATE   CbmKFParticleOnlineInterface 
+  PRIVATE   CbmKFParticleOnlineInterface
+  INTERFACE CbmYamlInterface
 )
 target_compile_definitions(Algo PUBLIC NO_ROOT)
 xpu_attach(Algo ${DEVICE_SRCS})
@@ -294,7 +294,6 @@ if (NOT CBM_ONLINE_STANDALONE)
 
   target_link_libraries(AlgoOffline
     PUBLIC    CbmData
-              CbmYamlInterface
               KfCoreOffline
               CaCoreOffline
               ROOT::GenVector
@@ -311,7 +310,8 @@ if (NOT CBM_ONLINE_STANDALONE)
               external::fles_monitoring
               cppzmq
               poolstl
-    PRIVATE   CbmKFParticleOnlineInterface 
+    PRIVATE   CbmKFParticleOnlineInterface
+    INTERFACE CbmYamlInterface
   )
   xpu_attach(AlgoOffline ${DEVICE_SRCS})
 
diff --git a/core/qa/CMakeLists.txt b/core/qa/CMakeLists.txt
index f115de3c75..9b022d7bb8 100644
--- a/core/qa/CMakeLists.txt
+++ b/core/qa/CMakeLists.txt
@@ -2,6 +2,7 @@ set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}/checker
   ${CMAKE_CURRENT_SOURCE_DIR}/report
   ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_SOURCE_DIR}/algo/base  # For "algo/base/yaml/*.h" included as relative "yaml/?????.h" to fit install tree
   )
 
 set(SRCS
@@ -63,6 +64,7 @@ set(PRIVATE_DEPENDENCIES
 
 set(INTERFACE_DEPENDENCIES
   ROOT::Graf
+  CbmYamlInterface
   )
 
 generate_cbm_library()
diff --git a/reco/KF/KFParticleInterface.cmake b/reco/KF/KFParticleInterface.cmake
index 7f594ec0a9..a09ae917a1 100644
--- a/reco/KF/KFParticleInterface.cmake
+++ b/reco/KF/KFParticleInterface.cmake
@@ -6,6 +6,7 @@ set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/Interface
   ${CMAKE_CURRENT_SOURCE_DIR}/KFQA
+  ${CMAKE_SOURCE_DIR}/algo/base  # For "algo/base/yaml/*.h" included as relative "yaml/?????.h" to fit install tree
   )
 
 set(SRCS
@@ -43,11 +44,11 @@ EndIf()
 IF (SSE_FOUND)
   Message(STATUS "KFParticleInterface will be compiled with SSE support")
   ADD_DEFINITIONS(-DHAVE_SSE)
-  SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS 
+  SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
   "-msse -O3")
 ELSE (SSE_FOUND)
   MESSAGE(STATUS "KFParticleInterface will be compiled without SSE support")
-  SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS 
+  SET_SOURCE_FILES_PROPERTIES(${SRCS} PROPERTIES COMPILE_FLAGS
   "-O3")
 ENDIF (SSE_FOUND)
 
@@ -57,7 +58,7 @@ set(LINKDEF ${LIBRARY_NAME}LinkDef.h)
 set(PUBLIC_DEPENDENCIES
   CbmData
   KF
-  FairRoot::Base  
+  FairRoot::Base
   ROOT::Core
   ROOT::Hist
   )
@@ -76,6 +77,7 @@ set(PRIVATE_DEPENDENCIES
 
 set(INTERFACE_DEPENDENCIES
   CbmRecoBase
+  CbmYamlInterface
   )
 
 Set(DEFINITIONS -DDO_TPCCATRACKER_EFF_PERFORMANCE -DNonhomogeneousField -DCBM -DUSE_TIMERS)
diff --git a/reco/L1/CMakeLists.txt b/reco/L1/CMakeLists.txt
index 6f6b1a79af..4e0573c8d4 100644
--- a/reco/L1/CMakeLists.txt
+++ b/reco/L1/CMakeLists.txt
@@ -16,6 +16,7 @@ set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}/L1Algo/utils
   ${CMAKE_CURRENT_SOURCE_DIR}/catools
   ${CMAKE_CURRENT_SOURCE_DIR}/utils
+  ${CMAKE_SOURCE_DIR}/algo/base  # For "algo/base/yaml/*.h" included as relative "yaml/?????.h" to fit install tree
 
 )
 
@@ -174,6 +175,10 @@ set(PRIVATE_DEPENDENCIES
   ROOT::RIO
 )
 
+set(INTERFACE_DEPENDENCIES
+  CbmYamlInterface
+)
+
 generate_cbm_library()
 
 add_dependencies(G__L1 KFPARTICLE)
diff --git a/reco/detectors/tof/CMakeLists.txt b/reco/detectors/tof/CMakeLists.txt
index 02561f15a6..42b61bf92c 100644
--- a/reco/detectors/tof/CMakeLists.txt
+++ b/reco/detectors/tof/CMakeLists.txt
@@ -1,7 +1,7 @@
 set(INCLUDE_DIRECTORIES
-  ${CBMROOT_SOURCE_DIR}/fles/flestools
   ${CMAKE_CURRENT_SOURCE_DIR}
   ${CMAKE_CURRENT_SOURCE_DIR}/unpack
+  ${CMAKE_SOURCE_DIR}/fles/flestools
   )
 
 
diff --git a/reco/tasks/CMakeLists.txt b/reco/tasks/CMakeLists.txt
index 991210bd39..87daab1083 100644
--- a/reco/tasks/CMakeLists.txt
+++ b/reco/tasks/CMakeLists.txt
@@ -3,7 +3,8 @@
 
 set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CBMROOT_SOURCE_DIR}
+  ${CMAKE_SOURCE_DIR}/algo       # For "algo/qa/*.h"        included as relative "qa/?????.h"   to fit install tree
+  ${CMAKE_SOURCE_DIR}/algo/base  # For "algo/base/yaml/*.h" included as relative "yaml/?????.h" to fit install tree
   )
 
 set(SRCS
@@ -58,6 +59,7 @@ set(PRIVATE_DEPENDENCIES
 
 set(INTERFACE_DEPENDENCIES
   external::fles_ipc
+  CbmYamlInterface
   )
 
 generate_cbm_library()
diff --git a/reco/tasks/CbmTaskDigiEventQa.cxx b/reco/tasks/CbmTaskDigiEventQa.cxx
index 00c542cf7e..b07b9b49fc 100644
--- a/reco/tasks/CbmTaskDigiEventQa.cxx
+++ b/reco/tasks/CbmTaskDigiEventQa.cxx
@@ -5,7 +5,7 @@
 #include "CbmTaskDigiEventQa.h"
 
 #include "CbmReco.h"  // for CbmRecoConfig
-#include "algo/qa/Histo1D.h"
+#include "qa/Histo1D.h"
 
 #include <FairRunOnline.h>
 #include <Logger.h>
diff --git a/sim/transport/steer/CMakeLists.txt b/sim/transport/steer/CMakeLists.txt
index 09ea11a22f..79ea0c3f0a 100644
--- a/sim/transport/steer/CMakeLists.txt
+++ b/sim/transport/steer/CMakeLists.txt
@@ -1,6 +1,6 @@
 set(INCLUDE_DIRECTORIES
   ${CMAKE_CURRENT_SOURCE_DIR}
-  ${CBMROOT_SOURCE_DIR}/core/config
+  ${CMAKE_SOURCE_DIR}/core/config
   )
 
 set(SRCS
-- 
GitLab


From 23e0325c46842f2ea0751047b4e22183bc6d3c3e Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Thu, 20 Mar 2025 15:18:54 +0100
Subject: [PATCH 2/3] make the CbmYamlInterface library use the same include
 with path convention as the rest of the code

---
 algo/base/yaml/CMakeLists.txt | 8 ++++----
 algo/base/yaml/Yaml.h         | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/algo/base/yaml/CMakeLists.txt b/algo/base/yaml/CMakeLists.txt
index f943052cf1..756401d832 100644
--- a/algo/base/yaml/CMakeLists.txt
+++ b/algo/base/yaml/CMakeLists.txt
@@ -1,5 +1,5 @@
 set(INCLUDE_DIRECTORIES
-  ${CMAKE_CURRENT_SOURCE_DIR}
+  ${CMAKE_SOURCE_DIR}/algo/base  # For "algo/base/yaml/*.h" included as relative "yaml/?????.h" to fit install tree
 )
 
 add_library(CbmYamlInterface INTERFACE)
@@ -10,13 +10,13 @@ target_include_directories(CbmYamlInterface
 
 target_link_libraries(CbmYamlInterface
   INTERFACE GSL
-            xpu 
-            fmt::fmt 
+            xpu
+            fmt::fmt
             external::yaml-cpp
 )
 
 install(
-  FILES 
+  FILES
     BaseTypes.h
     Property.h
     Yaml.h
diff --git a/algo/base/yaml/Yaml.h b/algo/base/yaml/Yaml.h
index 8745bd1416..56bd2246e0 100644
--- a/algo/base/yaml/Yaml.h
+++ b/algo/base/yaml/Yaml.h
@@ -3,11 +3,11 @@
    Authors: Felix Weiglhofer [committer] */
 #pragma once
 
-#include "BaseTypes.h"
 #include "Definitions.h"
-#include "Property.h"
 #include "compat/Filesystem.h"
 #include "util/EnumDict.h"
+#include "yaml/BaseTypes.h"
+#include "yaml/Property.h"
 
 #include <sstream>
 #include <string_view>
-- 
GitLab


From 79b61e1da2525e758f3d6163417da0553f00d0fc Mon Sep 17 00:00:00 2001
From: P-A Loizeau <p.-a.loizeau@gsi.de>
Date: Thu, 20 Mar 2025 16:34:31 +0100
Subject: [PATCH 3/3] Add pre-processor include guards in all of YAML interface
 lib files

---
 algo/base/yaml/BaseTypes.h | 3 +++
 algo/base/yaml/Property.h  | 4 ++++
 algo/base/yaml/Yaml.h      | 4 ++++
 3 files changed, 11 insertions(+)

diff --git a/algo/base/yaml/BaseTypes.h b/algo/base/yaml/BaseTypes.h
index 1a58763e2b..1743aace81 100644
--- a/algo/base/yaml/BaseTypes.h
+++ b/algo/base/yaml/BaseTypes.h
@@ -1,6 +1,8 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
+#ifndef CBM_YAML_BASETYPES_H
+#define CBM_YAML_BASETYPES_H
 #pragma once
 
 #include "Definitions.h"
@@ -139,3 +141,4 @@ namespace cbm::algo::yaml
 
 
 }  // namespace cbm::algo::yaml
+#endif  // CBM_YAML_BASETYPES_H
diff --git a/algo/base/yaml/Property.h b/algo/base/yaml/Property.h
index 644c77bfdc..223a978542 100644
--- a/algo/base/yaml/Property.h
+++ b/algo/base/yaml/Property.h
@@ -1,6 +1,8 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
+#ifndef CBM_YAML_PROPERTY_H
+#define CBM_YAML_PROPERTY_H
 #pragma once
 
 #include "Definitions.h"
@@ -82,3 +84,5 @@ namespace cbm::algo::yaml
 #define CBM_YAML_MERGE_PROPERTY()                                                                                      \
  public:                                                                                                               \
   static constexpr bool MergeProperty = true
+
+#endif  // CBM_YAML_PROPERTY_H
diff --git a/algo/base/yaml/Yaml.h b/algo/base/yaml/Yaml.h
index 56bd2246e0..e5dfa3d33a 100644
--- a/algo/base/yaml/Yaml.h
+++ b/algo/base/yaml/Yaml.h
@@ -1,6 +1,8 @@
 /* Copyright (C) 2023 FIAS Frankfurt Institute for Advanced Studies, Frankfurt / Main
    SPDX-License-Identifier: GPL-3.0-only
    Authors: Felix Weiglhofer [committer] */
+#ifndef CBM_YAML_YAML_H
+#define CBM_YAML_YAML_H
 #pragma once
 
 #include "Definitions.h"
@@ -305,3 +307,5 @@ namespace cbm::algo::yaml
 #define CBM_YAML_INSTANTIATE(type)                                                                                     \
   template type cbm::algo::yaml::Read<type>(const YAML::Node& node);                                                   \
   template std::string cbm::algo::yaml::Dump::operator()<type>(const type& value, int floatPrecision);
+
+#endif  // CBM_YAML_YAML_H
-- 
GitLab