diff --git a/DDCore/CMakeLists.txt b/DDCore/CMakeLists.txt index 5cf62168a9f2780ec6d8f00e49ca4515cfbcc967..b862ed3a9200e151ef4118e8acd8e53587c8830c 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 9b0863eec53f41fabde155052c920ebde1fdfd5f..5e175d2152e2f73b9eee8153d4aaccd4a8d7af2b 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 25458f2dc2a6c2d37130aaa1dbca5cb8a5957b47..777329c1caab0a3ac87c4f09dc406a623d51666a 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)