I am trying to make KFParticle works in O2. It has been installed during O2 installation, but is not properly configured. Sorry that i am not familiar with the new CMake system in O2. I have tried the following steps, But unfortunately it does not work.
(1) Add “find_package(KFParticle)” in “O2/dependencies/O2Dependencies.cmake”.
(2) Create “FindKFParticle.cmake” in the same folder “O2/dependencies/”. In this cmake file, I add the following lines:
add_library(KFParticle IMPORTED INTERFACE)
set_target_properties(KFParticle PROPERTIES IMPORTED_GLOBAL TRUE)
add_library(KFParticle::KFParticle ALIAS KFParticle)".
(3) In “O2/Analysis/Tasks/PWGHF/CMakeLists.txt”, i add the following lines:
PUBLIC_LINK_LIBRARIES O2::Framework O2::AnalysisDataModel O2::AnalysisCore O2::DetectorsVertexing ROOT::EG KFParticle::KFParticle
When trying to find KFParticle package, it returns "-- Could NOT find KFParticle (missing: KFParticle_DIR)”.
When compiling my task, it returns
“CMake Error at cmake/O2AddExecutable.cmake:94 (add_executable):
Target “O2exe-analysis-hf-candidate-creator-3prong-kf” links to target
“KFParticle::KFParticle” but the target was not found. Perhaps a
find_package() call is missing for an IMPORTED target, or an ALIAS target
Call Stack (most recent call first):
Can anyone help me to fix it?