From 4d00f3a56e9b70c8caf5f08c4e91498f6117747b Mon Sep 17 00:00:00 2001 From: Andre Sailer <andre.philippe.sailer@cern.ch> Date: Wed, 17 Jul 2019 12:52:26 +0200 Subject: [PATCH] Link GDML links against ROOT::Gdml --- DDCore/CMakeLists.txt | 6 +++--- DDRec/CMakeLists.txt | 5 +++-- cmake/DD4hepBuild.cmake | 14 +++++--------- 3 files changed, 11 insertions(+), 14 deletions(-) diff --git a/DDCore/CMakeLists.txt b/DDCore/CMakeLists.txt index 5cf62168a..b862ed3a9 100644 --- a/DDCore/CMakeLists.txt +++ b/DDCore/CMakeLists.txt @@ -88,17 +88,17 @@ new_dd4hep_add_plugin(DDCorePlugins SOURCES src/plugins/*.cpp LINK_LIBRARIES DDCore) # This plugins depends on the ROOT GDML readers. Hence, extra library -IF(${ROOT_gdml_FOUND}) +IF(TARGET ROOT::Gdml) new_dd4hep_add_plugin(DDGDMLPlugins SOURCES src/gdml/*.cpp - LINK_LIBRARIES DDCore ROOT::Core + LINK_LIBRARIES DDCore ROOT::Core ROOT::Gdml ) ELSE() MESSAGE(WARN "ROOT does not include GDML, not building DDCore GDML Plugins") ENDIF() #--------------------------- Specialized PYTHON plugin ---------------------------- -IF(ROOT_python_FOUND) +IF(TARGET ROOT::PyROOT) new_dd4hep_add_plugin(DDPythonPlugins SOURCES src/python/*.cpp LINK_LIBRARIES DDCore ROOT::Core ROOT::PyROOT diff --git a/DDRec/CMakeLists.txt b/DDRec/CMakeLists.txt index 9b0863eec..5e175d215 100644 --- a/DDRec/CMakeLists.txt +++ b/DDRec/CMakeLists.txt @@ -14,8 +14,9 @@ #---Add Library------------------------------------------------------------- new_dd4hep_add_dictionary( G__DDRec - SOURCES ../DDCore/include/ROOT/Warnings.h src/RecDictionary.h - LINKDEF include/ROOT/LinkDef.h + SOURCES ../DDCore/include/ROOT/Warnings.h + GENERATED src/RecDictionary.h + LINKDEF ../DDCore/include/ROOT/LinkDef.h DEPENDS DDCore DDParsers ) diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake index 25458f2dc..777329c1c 100644 --- a/cmake/DD4hepBuild.cmake +++ b/cmake/DD4hepBuild.cmake @@ -1666,15 +1666,11 @@ macro(DD4HEP_SETUP_ROOT_TARGETS) # ) #endforeach() # Non-standard ROOT components we need later on, we "import" them by hand for now - foreach(LIB PyROOT Geom GenVector Eve Graf3d RGL Gui RIO MathCore MathMore EG EGL Rint Tree Hist Physics) - ADD_LIBRARY(ROOT::${LIB} INTERFACE IMPORTED GLOBAL) - TARGET_LINK_LIBRARIES(ROOT::${LIB} INTERFACE ${LIB}) - # SET_TARGET_PROPERTIES(ROOT::${LIB} - # PROPERTIES - # INTERFACE_COMPILE_OPTIONS "${ROOT_CXX_FLAGS}" - # INTERFACE_INCLUDE_DIRECTORIES ${ROOT_INCLUDE_DIRS} - # IMPORTED_LOCATION ${ROOT_${LIB}_LIBRARY} - # ) + foreach(LIB PyROOT Geom GenVector Eve Graf3d RGL Gui RIO MathCore MathMore EG EGL Rint Tree Hist Physics Gdml) + IF(TARGET ${LIB}) + ADD_LIBRARY(ROOT::${LIB} INTERFACE IMPORTED GLOBAL) + TARGET_LINK_LIBRARIES(ROOT::${LIB} INTERFACE ${LIB} ROOT::Core) + ENDIF() endforeach() ENDIF(NOT TARGET ROOT::Core) -- GitLab