diff --git a/CMakeLists.txt b/CMakeLists.txt index c2b51c2680a3d9ac6c89c329faff028d4c42da50..f67c5a4e5fcd9c2a966725f0462f52f43a034655 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -203,10 +203,8 @@ if(APPLE) message(STATUS "DD4HEP_LIBRARY_PATH= $ENV{DD4HEP_LIBRARY_PATH}") endif() - INSTALL(EXPORT DD4hep NAMESPACE DD4hep:: FILE DD4hepConfig-targets.cmake DESTINATION cmake - EXPORT_LINK_INTERFACE_LIBRARIES - ) \ No newline at end of file + ) diff --git a/DDAlign/CMakeLists.txt b/DDAlign/CMakeLists.txt index 5ed61510eaae9a2aad9716d51f6ab16e3e6c025a..5706702595788f4cc5e0774f04a7bb7131d3a2a2 100644 --- a/DDAlign/CMakeLists.txt +++ b/DDAlign/CMakeLists.txt @@ -19,18 +19,14 @@ target_include_directories(DDAlign $<INSTALL_INTERFACE:include> ) -target_link_libraries(DDAlign - PUBLIC - DDCore - ) +target_link_libraries(DDAlign PUBLIC DDCore) -new_dd4hep_add_plugin(DDAlignPlugins +dd4hep_add_plugin(DDAlignPlugins SOURCES src/plugins/*.cpp - LINK_LIBRARIES DDAlign + USES DDAlign ) - set_target_properties(DDAlign DDAlignPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION}) -INSTALL(DIRECTORY include/DDAlign DESTINATION include) -INSTALL(TARGETS DDAlign DDAlignPlugins EXPORT DD4hep DESTINATION lib) +install(DIRECTORY include/DDAlign DESTINATION include) +install(TARGETS DDAlign DDAlignPlugins EXPORT DD4hep DESTINATION lib) diff --git a/DDCond/CMakeLists.txt b/DDCond/CMakeLists.txt index cb1e1f6c85cf341998fa81db0bdd04d7a253764f..761b10e8a231f0a3e7d6318e48c53a8923204b3b 100644 --- a/DDCond/CMakeLists.txt +++ b/DDCond/CMakeLists.txt @@ -8,24 +8,14 @@ # For the list of contributors see $DD4hepINSTALL/doc/CREDITS. # #========================================================================== -#---Generate ROOT dictionary----------------------------------------------------- - -#find_package (ROOT 6.08 REQUIRED COMPONENTS Geom GenVector Eve Gui Graf3d RGL EG) # COMPONENTS Geom GenVector Eve Gui Graf3d RGL EG -new_dd4hep_add_dictionary(G__DDCond +dd4hep_add_dictionary(G__DDCond SOURCES src/ConditionsDictionary.h - DEPENDS DDCore DDParsers + USES DDCore DDParsers ) file(GLOB DDCond_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp) -#---DDCond library -------------------------------------------------------------- -add_library(DDCond SHARED ${DDCond_SOURCES} - G__DDCond.cxx - ) -target_link_libraries(DDCond - PUBLIC - DDCore - ) +add_library(DDCond SHARED ${DDCond_SOURCES} G__DDCond.cxx) target_include_directories(DDCond PUBLIC @@ -33,14 +23,14 @@ target_include_directories(DDCond $<INSTALL_INTERFACE:include> ) +target_link_libraries(DDCond PUBLIC DDCore) -#---DDCond components ----------------------------------------------------------- -new_dd4hep_add_plugin(DDCondPlugins - SOURCES src/plugins/*.cpp src/Type1/*.cpp - LINK_LIBRARIES DDCond) - +dd4hep_add_plugin(DDCondPlugins + SOURCES src/plugins/*.cpp src/Type1/*.cpp + USES DDCond + ) set_target_properties(DDCond DDCondPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION}) -INSTALL(DIRECTORY include/DDCond DESTINATION include) -INSTALL(TARGETS DDCond DDCondPlugins EXPORT DD4hep DESTINATION lib) +install(DIRECTORY include/DDCond DESTINATION include) +install(TARGETS DDCond DDCondPlugins EXPORT DD4hep DESTINATION lib) diff --git a/DDCore/CMakeLists.txt b/DDCore/CMakeLists.txt index 55dd3cedb7289ef2ada98e3074f329b454a46148..84bd8b2bc94b7bb310cf5aa6d2ad7a16a53b1fe1 100644 --- a/DDCore/CMakeLists.txt +++ b/DDCore/CMakeLists.txt @@ -9,10 +9,8 @@ # For the list of contributors see $DD4hepINSTALL/doc/CREDITS. # #================================================================================= -SET(PACKAGE DDCore) - #---Generate ROOT dictionary------------------------------------------------------ -new_dd4hep_add_dictionary( G__DD4hep +dd4hep_add_dictionary( G__DD4hep SOURCES include/ROOT/Warnings.h include/DD4hep/*.h include/DD4hep/detail/*.h @@ -30,25 +28,25 @@ new_dd4hep_add_dictionary( G__DD4hep include/XML/tinyxml.h include/XML/tinystring.h LINKDEF include/ROOT/LinkDef.h - DEPENDS DDParsers ${XML_LIBRARIES} + USES DDParsers ${XML_LIBRARIES} ) -new_dd4hep_add_dictionary( G__DD4hepGeo +dd4hep_add_dictionary( G__DD4hepGeo SOURCES include/ROOT/Warnings.h src/GeoDictionary.h LINKDEF include/ROOT/LinkDef.h - DEPENDS DDParsers ${XML_LIBRARIES} + USES DDParsers ${XML_LIBRARIES} ) -new_dd4hep_add_dictionary( G__DD4hepProperties +dd4hep_add_dictionary( G__DD4hepProperties SOURCES include/ROOT/Warnings.h src/PropertyDictionary.h LINKDEF include/ROOT/LinkDef.h - DEPENDS DDParsers ${XML_LIBRARIES} + USES DDParsers ${XML_LIBRARIES} ) -new_dd4hep_add_dictionary( G__DD4hepSegmentations +dd4hep_add_dictionary( G__DD4hepSegmentations SOURCES include/ROOT/Warnings.h src/SegmentationDictionary.h LINKDEF include/ROOT/LinkDef.h - DEPENDS DDParsers ${XML_LIBRARIES} + USES DDParsers ${XML_LIBRARIES} ) file(GLOB DDCore_SOURCES src/*.cpp src/segmentations/*.cpp src/XML/*.cpp) @@ -73,9 +71,8 @@ target_link_libraries(DDCore PUBLIC DD4hepGaudiPluginMgr DDParsers - ROOT::Core ROOT::Rint ROOT::Tree ROOT::Physics - ROOT::Geom ROOT::GenVector - ${XML_LIBRARIES} # XercesC or not + ROOT::Core ROOT::Rint ROOT::Tree ROOT::Physics ROOT::Geom ROOT::GenVector + ${XML_LIBRARIES} ) if(${CMAKE_VERSION} VERSION_GREATER 3.7.99) @@ -85,16 +82,14 @@ if(${CMAKE_VERSION} VERSION_GREATER 3.7.99) ) endif() - -# # Generate DDCore plugins--------------------------------------------------------- -new_dd4hep_add_plugin(DDCorePlugins SOURCES src/plugins/*.cpp - LINK_LIBRARIES DDCore) +# Generate DDCore plugins--------------------------------------------------------- +dd4hep_add_plugin(DDCorePlugins SOURCES src/plugins/*.cpp USES DDCore) # This plugins depends on the ROOT GDML readers. Hence, extra library IF(TARGET ROOT::Gdml) - new_dd4hep_add_plugin(DDGDMLPlugins + dd4hep_add_plugin(DDGDMLPlugins SOURCES src/gdml/*.cpp - LINK_LIBRARIES DDCore ROOT::Core ROOT::Gdml + USES DDCore ROOT::Core ROOT::Gdml ) set_target_properties(DDGDMLPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION}) install(TARGETS DDGDMLPlugins EXPORT DD4hep LIBRARY DESTINATION lib) @@ -104,9 +99,9 @@ ENDIF() #--------------------------- Specialized PYTHON plugin ---------------------------- IF(TARGET ROOT::PyROOT) - new_dd4hep_add_plugin(DDPythonPlugins + dd4hep_add_plugin(DDPythonPlugins SOURCES src/python/*.cpp - LINK_LIBRARIES DDCore ROOT::Core ROOT::PyROOT + USES DDCore ROOT::Core ROOT::PyROOT ) set_target_properties(DDPythonPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION}) install(TARGETS DDPythonPlugins EXPORT DD4hep LIBRARY DESTINATION lib) @@ -114,12 +109,12 @@ ELSE() MESSAGE(WARN "ROOT does not include PyRoot, not building DDCore DDPython Plugins") ENDIF() -# -# -#---Package installation procedure(s) ---------------------------------------------- -dd4hep_install_files(FILES python/*.py DESTINATION python) +# install python files +file(GLOB DDCore_Python python/*.py) +install(FILES ${DDCore_Python} DESTINATION python) -INSTALL(DIRECTORY +# install header files +install(DIRECTORY include/DDSegmentation include/DD4hep include/XML @@ -130,4 +125,4 @@ INSTALL(DIRECTORY ) set_target_properties(DDCore DDCorePlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION}) -INSTALL(TARGETS DDCore DDCorePlugins EXPORT DD4hep LIBRARY DESTINATION lib) +install(TARGETS DDCore DDCorePlugins EXPORT DD4hep LIBRARY DESTINATION lib) diff --git a/DDDetectors/CMakeLists.txt b/DDDetectors/CMakeLists.txt index 5c87be38dba925dff32e3b4cdc46e4baff57f244..15ae006eec5d847293f2215c1275baf624627f2c 100644 --- a/DDDetectors/CMakeLists.txt +++ b/DDDetectors/CMakeLists.txt @@ -17,10 +17,10 @@ # #-------------------------------------------------------------------------- -new_dd4hep_add_plugin(DDDetectors +dd4hep_add_plugin(DDDetectors SOURCES src/*.cpp - LINK_LIBRARIES DDRec - INCLUDE_DIRS $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> + USES DDRec + INCLUDES $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> ) set_target_properties(DDDetectors PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION}) diff --git a/DDDigi/CMakeLists.txt b/DDDigi/CMakeLists.txt index 1970df099c5076a45f076fe1515a6addb6894d58..64e90efb806c3bf37f8b03ba2f56ac1ca2a64eef 100644 --- a/DDDigi/CMakeLists.txt +++ b/DDDigi/CMakeLists.txt @@ -33,16 +33,16 @@ else() endif() #--------------------------- Legacy libraries ------------------------------------- -new_dd4hep_add_dictionary(G__DDDigi +dd4hep_add_dictionary(G__DDDigi SOURCES ../DDCore/include/ROOT/Warnings.h python/DDDigiDict.C LINKDEF ../DDCore/include/ROOT/LinkDef.h - DEPENDS DDCore ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO Boost::boost + USES DDCore ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO Boost::boost ) #--------------------------- Plugin library for the digitization framework ------- -new_dd4hep_add_plugin(DDDigiPlugins +dd4hep_add_plugin(DDDigiPlugins SOURCES plugins/*.cpp GENERATED G__DDDigi.cxx - LINK_LIBRARIES DDDigi + USES DDDigi ) #---Package installation procedure(s) ---------------------------------------------- diff --git a/DDEve/CMakeLists.txt b/DDEve/CMakeLists.txt index 52fa2a2fc4977e6e2cae9faf8f087a4c8297479e..2fc072e412aa453cb9241dd435e2c8dc45d7be56 100644 --- a/DDEve/CMakeLists.txt +++ b/DDEve/CMakeLists.txt @@ -17,14 +17,14 @@ target_include_directories(DDEve_Interface ) target_link_libraries(DDEve_Interface INTERFACE ROOT::Core ROOT::Rint ROOT::Eve ROOT::Gui ROOT::Graf3d ROOT::RGL ROOT::EG) -new_dd4hep_add_dictionary(G__DDEve +dd4hep_add_dictionary(G__DDEve SOURCES ../DDCore/include/ROOT/Warnings.h include/DDEve/*.h EXCLUDE include/DDEve/Utilities.h include/DDEve/ParticleActors.h include/DDEve/HitActors.h include/DDEve/Factories.h LINKDEF ../DDCore/include/ROOT/LinkDef.h - DEPENDS DDCore + USES DDCore ) if(TARGET LCIO::LCIO) @@ -32,16 +32,16 @@ if(TARGET LCIO::LCIO) SET(DDEVE_LCIO_LINK LCIO::LCIO) endif() -new_dd4hep_add_plugin(DDEvePlugins SOURCES src/*.cpp ${DDEVE_LCIO_SOURCES} - GENERATED G__DDEve.cxx - LINK_LIBRARIES DDCore DDEve_Interface ${DDEVE_LCIO_LINK} +dd4hep_add_plugin(DDEvePlugins SOURCES src/*.cpp ${DDEVE_LCIO_SOURCES} + GENERATED G__DDEve.cxx + USES DDCore DDEve_Interface ${DDEVE_LCIO_LINK} ) if(DD4HEP_USE_GEANT4) - new_dd4hep_add_dictionary(G__DDG4IO + dd4hep_add_dictionary(G__DDG4IO SOURCES ../DDCore/include/ROOT/Warnings.h DDEve/DDG4IO.C LINKDEF ../DDCore/include/ROOT/LinkDef.h - DEPENDS DDG4 + USES DDG4 ) add_library(DDG4IO SHARED DDEve/IO.cpp G__DDG4IO.cxx) target_link_libraries(DDG4IO DDG4 DDEve_Interface) diff --git a/DDG4/CMakeLists.txt b/DDG4/CMakeLists.txt index 289d6a14d4c39fc99d0e6973bdd8e21efb372be5..038b9c1769177fa063ce3d513b1e1540bb36ed1a 100644 --- a/DDG4/CMakeLists.txt +++ b/DDG4/CMakeLists.txt @@ -35,19 +35,17 @@ target_include_directories(DDG4 BEFORE ) #--------------------------- Legacy libraries (for Frank) ------------------------- -new_dd4hep_add_plugin(DDG4Legacy SOURCES legacy/*.cpp - LINK_LIBRARIES DDG4 - ) +dd4hep_add_plugin(DDG4Legacy SOURCES legacy/*.cpp USES DDG4) #----------------------------------------------------------------------------------- -new_dd4hep_add_dictionary( G__DDG4 +dd4hep_add_dictionary( G__DDG4 SOURCES python/DDG4Dict.C - DEPENDS DDCore DDParsers DDG4 Geant4::Interface + USES DDCore DDParsers DDG4 Geant4::Interface ) #--------------------------- Plugin library for the simulation framework --------- -new_dd4hep_add_plugin(DDG4Plugins - SOURCES plugins/*.cpp +dd4hep_add_plugin(DDG4Plugins + SOURCES plugins/*.cpp GENERATED G__DDG4.cxx - LINK_LIBRARIES ROOT::Core ${CLHEP} DDG4 ${XML_LIBRARIES} DDParsers + USES ROOT::Core ${CLHEP} DDG4 ${XML_LIBRARIES} DDParsers ) #--------------------------- Plugin library for the simulation framework --------- @@ -56,12 +54,12 @@ find_package(PythonInterp 2 REQUIRED) find_package(PythonLibs 2) if(PYTHONLIBS_FOUND) MESSAGE(STATUS "Python found, creating DDG4Python Dictionary") - new_dd4hep_add_dictionary(G__DDG4Python + dd4hep_add_dictionary(G__DDG4Python SOURCES src/python/DDG4Python.C - DEPENDS DDCore DDParsers DDG4 ROOT::Core Geant4::Interface + USES DDCore DDParsers DDG4 ROOT::Core Geant4::Interface ) - new_dd4hep_add_dictionary(G__DDPython - SOURCES tpython/DDPython.C + dd4hep_add_dictionary(G__DDPython + SOURCES tpython/DDPython.C INCLUDES ${PYTHON_INCLUDE_DIRS} ) if(TARGET ROOT::PyROOT) @@ -74,10 +72,10 @@ if(PYTHONLIBS_FOUND) # python header not cxx17 compatible, gives error in clang target_compile_options(DDPython PUBLIC -Wno-register) ENDIF() - new_dd4hep_add_plugin(DDG4Python - SOURCES src/python/*.cpp + dd4hep_add_plugin(DDG4Python + SOURCES src/python/*.cpp GENERATED G__DDG4Python.cxx - LINK_LIBRARIES DDG4 DDPython + USES DDG4 DDPython ) #---Helper to overcome deficiency of the python executable concerning multi-threading add_executable(pyddg4 pyddg4.cpp) @@ -96,9 +94,9 @@ endif() #--------------------------- Plugin library for the simulation framework --------- #--------------------------- LCIO Plugins for new simulation framework ----------- IF(TARGET LCIO::LCIO) - new_dd4hep_add_plugin(DDG4LCIO + dd4hep_add_plugin(DDG4LCIO SOURCES lcio/*.cpp - LINK_LIBRARIES DDG4 LCIO::LCIO + USES DDG4 LCIO::LCIO ) install(TARGETS DDG4LCIO EXPORT DD4hep LIBRARY DESTINATION lib) set_target_properties(DDG4LCIO PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION}) @@ -107,9 +105,9 @@ ENDIF() # #--------------------------- DDRec dependent Plugins ----------------------------- #This does not compile at the moment # IF(TARGET DDRec) -# new_dd4hep_add_plugin(DDG4Reco +# dd4hep_add_plugin(DDG4Reco # SOURCES reco/*.cpp -# LINK_LIBRARIES DDCore DDG4 DDRec +# USES DDCore DDG4 DDRec # ) # install(TARGETS DDG4Reco EXPORT DD4hep LIBRARY DESTINATION lib) # ENDIF() diff --git a/DDParsers/CMakeLists.txt b/DDParsers/CMakeLists.txt index 201728d74b5d8a98ee20cf1147f3e2bb33254e36..2dbadf735ecebcac6d111f21546fe1b9715596aa 100644 --- a/DDParsers/CMakeLists.txt +++ b/DDParsers/CMakeLists.txt @@ -13,6 +13,7 @@ file(GLOB DDParsers_SOURCES src/Parsers/*.cpp src/Evaluator/*.cpp) if(Boost_FOUND) file(GLOB DDParsers_SPIRIT_SOURCES src/Spirit/*.cpp) + set(BOOST_LIB Boost::boost) endif() add_library(DDParsers SHARED ${DDParsers_SOURCES} ${DDParsers_SPIRIT_SOURCES}) @@ -27,14 +28,9 @@ target_include_directories(DDParsers $<INSTALL_INTERFACE:include> ) -target_include_directories(DDParsers - SYSTEM - PUBLIC - $<TARGET_PROPERTY:ROOT::Core,INTERFACE_INCLUDE_DIRECTORIES> - $<$<BOOL:Boost_FOUND>:$<TARGET_PROPERTY:Boost::boost,INTERFACE_INCLUDE_DIRECTORIES>> - ) - target_link_libraries(DDParsers PUBLIC + ROOT::Core + ${BOOST_LIB} ${XML_LIBRARIES} ) diff --git a/DDRec/CMakeLists.txt b/DDRec/CMakeLists.txt index 3ae485f44beff0aa37328bf0431a1d86644dca99..10f48c70bc99bd9d0aa103b105bff21803c3cf0e 100644 --- a/DDRec/CMakeLists.txt +++ b/DDRec/CMakeLists.txt @@ -11,9 +11,7 @@ # #========================================================================== -#---Add Library------------------------------------------------------------- - -new_dd4hep_add_dictionary( G__DDRec +dd4hep_add_dictionary( G__DDRec SOURCES ../DDCore/include/ROOT/Warnings.h GENERATED src/RecDictionary.h LINKDEF ../DDCore/include/ROOT/LinkDef.h @@ -59,19 +57,19 @@ if(GEAR_FOUND) endif() -new_dd4hep_add_plugin(DDRecPlugins +dd4hep_add_plugin(DDRecPlugins SOURCES src/plugins/*.cpp ${DDREC_PLUGIN_GEAR} - LINK_LIBRARIES DDRec + USES DDRec DEFINITIONS ${DDREC_PLUGIN_DEFINITIONS} ) if(DD4HEP_USE_GEAR) - FIND_PACKAGE(Gear REQUIRED COMPONENTS geartgeo) + find_package(Gear REQUIRED COMPONENTS geartgeo) add_executable(convertToGear src/convertToGear.cc) target_link_libraries(convertToGear ${GEAR_LIBRARIES} ${GEAR_COMPONENT_LIBRARIES} DDRec) target_compile_definitions(convertToGear PUBLIC DD4HEP_USE_GEAR) else() - FIND_PACKAGE(Gear COMPONENTS geartgeo QUIET) + find_package(Gear COMPONENTS geartgeo QUIET) IF(GEAR_FOUND) add_executable(convertToGear src/convertToGear.cc) target_link_libraries(convertToGear ${GEAR_LIBRARIES} ${GEAR_COMPONENT_LIBRARIES} DDRec) @@ -82,6 +80,6 @@ endif() set_target_properties(DDRec DDRecPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION}) file(GLOB DDRec_python python/*.py) -INSTALL(FILES ${DDRec_python} DESTINATION python) -INSTALL(DIRECTORY include/DDRec DESTINATION include) -INSTALL(TARGETS DDRec DDRecPlugins EXPORT DD4hep LIBRARY DESTINATION lib) +install(FILES ${DDRec_python} DESTINATION python) +install(DIRECTORY include/DDRec DESTINATION include) +install(TARGETS DDRec DDRecPlugins EXPORT DD4hep LIBRARY DESTINATION lib) diff --git a/UtilityApps/CMakeLists.txt b/UtilityApps/CMakeLists.txt index f05726ff3461f31dcef56627c93c86cbcf66c7f8..46ab1e913df72b764e5fd5afa362a0b025a7b1fc 100644 --- a/UtilityApps/CMakeLists.txt +++ b/UtilityApps/CMakeLists.txt @@ -49,18 +49,18 @@ if(BUILD_TESTING) endif() #----------------------------------------------------------------------------------- endif() -new_dd4hep_add_dictionary( G__eve +dd4hep_add_dictionary( G__eve SOURCES src/EvNavHandler.h LINKDEF src/LinkDef.h - DEPENDS DDCore ROOT::Geom + USES DDCore ROOT::Geom ) # #----------------------------------------------------------------------------------- if (DD4HEP_USE_LCIO) - new_dd4hep_add_dictionary( G__eve1 + dd4hep_add_dictionary( G__eve1 SOURCES src/EvNavHandler.h LINKDEF src/LinkDef.h - DEPENDS DDCore ROOT::Geom + USES DDCore ROOT::Geom ) add_executable(teveLCIO G__eve1.cxx src/teve_display.cpp src/next_event_lcio.cpp) target_link_libraries(teveLCIO DDRec LCIO::LCIO ROOT::Core ROOT::Eve ROOT::Gui ROOT::Graf3d ROOT::RGL) diff --git a/cmake/DD4hepBuild.cmake b/cmake/DD4hepBuild.cmake index 6ae7a7912d05b6839646ec93c8484fe9c49f342b..9cabb6d5d4aef552bae65e95719534ac6388817a 100644 --- a/cmake/DD4hepBuild.cmake +++ b/cmake/DD4hepBuild.cmake @@ -836,257 +836,6 @@ function ( dd4hep_package_properties name upper enabled ) set ( ${enabled} ${e} PARENT_SCOPE ) endfunction() -#--------------------------------------------------------------------------------------------------- -# dd4hep_package -# -# Arguments -# --------- -# packageName -> name of the package -# INCLUDE_DIRS -> Include directories needed to compile package binaries -# INSTALL_INCLUDES -> Installation directive for header files -# LINK_LIBRARIES -> Libraries needed to link the binary -# USES -> Required package dependencies -# OPTIONAL -> Optional package dependency e.g. [LCIO REQUIRED COMPONENTS] -# -# \author M.Frank -# \version 1.0 -# -#--------------------------------------------------------------------------------------------------- -function( dd4hep_package packageName ) - #cmake_parse_arguments(ARG "" "LIBRARY;MAJOR;MINOR;PATCH;OUTPUT;INSTALL" "USES;OPTIONAL;LINK_LIBRARIES;INCLUDE_DIRS;INSTALL_INCLUDES" ${ARGN}) - cmake_parse_arguments(ARG "" "LIBRARY;MAJOR;MINOR;PATCH" "USES;OPTIONAL;LINK_LIBRARIES;INCLUDE_DIRS;INSTALL_INCLUDES" ${ARGN}) - set_property( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY PACKAGE_NAME ${packageName} ) - string ( TOUPPER "${packageName}" PKG_NAME ) - - set ( missing_uses ) - foreach ( use ${ARG_USES} ) - dd4hep_unpack_package_opts ( TEST ${use} ) - dd4hep_find_package ( ${TEST_NAME} pkg_found ) - if ( NOT "${pkg_found}" ) - set ( missing_uses ${missing_uses} ${TEST_NAME} ) - endif() - endforeach() - - if ( NOT "${missing_uses}" STREQUAL "" ) - dd4hep_print ( "+-------------------------------------------------------------------------" ) - dd4hep_skipmsg ( "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" ) - dd4hep_skipmsg ( "PACKAGE ${packageName} / ${PKG_NAME} SKIPPED! Missing dependency: ${missing_uses}" ) - dd4hep_skipmsg ( "++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++" ) - set ( use "OFF" ) - set_property ( GLOBAL PROPERTY DD4HEP_USE_${PKG_NAME} ${use} ) - else() - dd4hep_set_version ( ${packageName} MAJOR ${ARG_MAJOR} MINOR ${ARG_MINOR} PATCH ${ARG_PATCH} ) - dd4hep_to_parent_scope ( ${packageName}_VERSION_MAJOR ) - dd4hep_to_parent_scope ( ${packageName}_VERSION_MINOR ) - dd4hep_to_parent_scope ( ${packageName}_VERSION_PATCH ) - dd4hep_to_parent_scope ( ${packageName}_VERSION ) - dd4hep_to_parent_scope ( ${packageName}_SOVERSION ) - set ( vsn "Version: ( ${${packageName}_VERSION_MAJOR}.${${packageName}_VERSION_MINOR}.${${packageName}_VERSION_PATCH} )" ) - dd4hep_print ( "+------------------------------------------- <<<< PACKAGE ${packageName} >>>> ${vsn}" ) - - dd4hep_use_package ( "Package[${packageName}]" PACKAGE PACKAGE - USES ${ARG_USES} - OPTIONAL ${ARG_OPTIONAL} ) - - if ( "${PACKAGE_MISSING}" STREQUAL "" ) - # - # - # - #dd4hep_configure_output ( OUTPUT "${ARG_OUTPUT}" INSTALL "${ARG_INSTALL}" ) - # - # - set (used_incs ${PACKAGE_INCLUDE_DIRS} ) - set (used_libs ${PACKAGE_LINK_LIBRARIES} ) - # - # Define the include directories including dependent packages - # - list(APPEND used_incs ${CMAKE_CURRENT_SOURCE_DIR}/include ) - foreach( inc ${ARG_INCLUDE_DIRS} ) - list(INSERT used_incs 0 ${CMAKE_CURRENT_SOURCE_DIR}/${inc} ) - endforeach() - # - # Build the list of link libraries required to build the package library and plugins etc. - # - dd4hep_make_unique_list ( used_libs VALUES ${used_libs} ${ARG_LINK_LIBRARIES} ) - dd4hep_make_unique_list ( used_incs VALUES ${used_incs} ) - # - # Save the variables in the context of the current source directory (ie. THIS package) - # - set ( use "ON" ) - set_property ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY PACKAGE_INCLUDE_DIRS ${used_incs} ) - set_property ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY PACKAGE_LINK_LIBRARIES ${used_libs} ) - - set_property ( GLOBAL PROPERTY ${PKG_NAME}_LIBRARIES ${used_libs} ) - set_property ( GLOBAL PROPERTY DD4HEP_USE_${PKG_NAME} ${use} ) - set_property ( GLOBAL PROPERTY ${PKG_NAME}_INCLUDE_DIRS ${used_incs} ) - set_property ( GLOBAL PROPERTY ${PKG_NAME}_USES ${PACKAGE_USES} ) - # - # Add package to 'internal' package list - # - get_property ( all_packages GLOBAL PROPERTY DD4HEP_ALL_PACKAGES ) - set ( all_packages ${PKG_NAME} ${all_packages} ) - set_property ( GLOBAL PROPERTY DD4HEP_ALL_PACKAGES ${all_packages} ) - get_property ( use GLOBAL PROPERTY DD4HEP_USE_${PKG_NAME} ) - # - # Some debugging: - # - dd4hep_debug ( "Property: DD4HEP_USE_${PKG_NAME}=${use}" ) - dd4hep_debug ( "Used Libs: ${used_libs}" ) - dd4hep_debug ( "Used Incs: ${used_incs}" ) - # - # Define the installation pathes of the headers. - # - dd4hep_install_dir ( ${ARG_INSTALL_INCLUDES} DESTINATION include ) - else() - dd4hep_fatal ( "Missing package dependencies: ${PACKAGE_MISSING}" ) - endif() - set (used_incs ${PACKAGE_INCLUDE_DIRS} ) - set (used_libs ${PACKAGE_LINK_LIBRARIES} ) - # - # Define the include directories including dependent packages - # - list(APPEND used_incs ${CMAKE_CURRENT_SOURCE_DIR}/include ) - foreach( inc ${ARG_INCLUDE_DIRS} ) - list( APPEND used_incs ${CMAKE_CURRENT_SOURCE_DIR}/${inc} ) - endforeach() - # - # Build the list of link libraries required to build the package library and plugins etc. - # - dd4hep_make_unique_list ( used_libs VALUES ${used_libs} ${ARG_LINK_LIBRARIES} ) - dd4hep_make_unique_list ( used_incs VALUES ${used_incs} ) - # - # Save the variables in the context of the current source directory (ie. THIS package) - # - set ( use "ON" ) - set_property ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY PACKAGE_INCLUDE_DIRS ${used_incs} ) - set_property ( DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY PACKAGE_LINK_LIBRARIES ${used_libs} ) - - set_property ( GLOBAL PROPERTY ${PKG_NAME}_LIBRARIES ${used_libs} ) - set_property ( GLOBAL PROPERTY DD4HEP_USE_${PKG_NAME} ${use} ) - set_property ( GLOBAL PROPERTY ${PKG_NAME}_INCLUDE_DIRS ${used_incs} ) - set_property ( GLOBAL PROPERTY ${PKG_NAME}_USES ${PACKAGE_USES} ) - # - # Add package to 'internal' package list - # - get_property ( all_packages GLOBAL PROPERTY DD4HEP_ALL_PACKAGES ) - set ( all_packages ${PKG_NAME} ${all_packages} ) - set_property ( GLOBAL PROPERTY DD4HEP_ALL_PACKAGES ${all_packages} ) - get_property ( use GLOBAL PROPERTY DD4HEP_USE_${PKG_NAME} ) - # - # Some debugging: - # - dd4hep_debug ( "Property: DD4HEP_USE_${PKG_NAME}=${use}" ) - dd4hep_debug ( "Used Libs: ${used_libs}" ) - dd4hep_debug ( "Used Incs: ${used_incs}" ) - # - # Define the installation pathes of the headers. - # - dd4hep_install_dir ( ${ARG_INSTALL_INCLUDES} DESTINATION include ) - # - endif() -endfunction() - -#--------------------------------------------------------------------------------------------------- -# dd4hep_add_library -# -# Arguments -# --------- -# binary -> plugin name -# SOURCES -> list of source files. Will be expanded to absolute names -# -# The following variables EXTEND the package defaults -# INCLUDE_DIRS -> Additional include directories need to compile the binary -# LINK_LIBRARIES -> Additional libraries needed to link the binary -# USES -> Required package dependencies -# OPTIONAL -> Optional package dependency -# if required e.g. [LCIO REQUIRED SOURCES aaa.cpp] the plugin will NOT be built -# else e.g. [LCIO SOURCES aaa.cpp] the plugin will be built, but -# the source files will be omitted. -# DEFINITIONS -> Optional compiler definitions to compile the sources -# -# \author M.Frank -# \version 1.0 -# -#--------------------------------------------------------------------------------------------------- -function( dd4hep_add_library binary building ) - cmake_parse_arguments ( ARG "NODEFAULTS;NOINSTALL" "" "SOURCES;GENERATED;LINK_LIBRARIES;INCLUDE_DIRS;USES;OPTIONAL;DEFINITIONS;PRINT" ${ARGN} ) - dd4hep_package_properties( pkg PKG_NAME enabled ) - set ( tag "Library[${pkg}] -> ${binary}" ) - if ( NOT "${ARG_PRINT}" STREQUAL "" ) - set ( tag ${ARG_PRINT} ) - endif() - - if ( NOT "${enabled}" ) - dd4hep_skipmsg ( "${tag} DISBALED -- package is not built!" ) - else() - dd4hep_debug( "+------------------------------------------- <<<< LIBRARY ${pkg}:${binary} >>>> Version: ${${pkg}_VERSION}" ) - set ( building_binary "OFF" ) - - if ( NOT "${ARG_OPTIONAL}" STREQUAL "" ) - dd4hep_handle_optional_sources ( ${tag} "${ARG_OPTIONAL}" optional_missing optional_uses optional_sources ) - endif() - - if ( NOT "${optional_missing}" STREQUAL "" ) - dd4hep_print ( "|++> ${tag} (optional) skipped. Missing dependency: ${optional_missing}" ) - else() - if ( ${ARG_NODEFAULTS} ) - set ( LOCAL_LINK_LIBRARIES ) - set ( LOCAL_LINK_LIBRARIES ) - set ( LOCAL_DEFINITIONS ) - else() - dd4hep_use_package( "${tag}" PACKAGE LOCAL - USES ${ARG_USES} ${optional_uses} - OPTIONAL ${ARG_OPTIONAL} ) - endif() - if ( NOT "${LOCAL_MISSING}" STREQUAL "" ) - dd4hep_print ( "|++> ${tag} skipped. Missing dependency: ${missing}" ) - endif() - # - dd4hep_make_unique_list( pkg_incs VALUES ${LOCAL_INCLUDE_DIRS} ${ARG_INCLUDE_DIRS} ) - dd4hep_make_unique_list( pkg_libs VALUES ${LOCAL_LINK_LIBRARIES} ${ARG_LINK_LIBRARIES} ) - dd4hep_make_unique_list( pkg_defs VALUES ${LOCAL_DEFINITIONS} ${ARG_DEFINITIONS} ) - # - file ( GLOB sources ${ARG_SOURCES} ) - list ( APPEND sources ${optional_sources} ) - if ( NOT "${ARG_GENERATED}" STREQUAL "" ) - # - # root-cint produces warnings of type 'unused-function' disable them on generated files - foreach ( f in ${ARG_GENERATED} ) - set_source_files_properties( ${f} PROPERTIES COMPILE_FLAGS "-Wno-unused-function -Wno-overlength-strings" GENERATED TRUE ) - endforeach() - list ( APPEND sources ${ARG_GENERATED} ) - endif() - # - # - if ( NOT "${sources}" STREQUAL "" ) - dd4hep_make_unique_list ( sources VALUES ${sources} ) - dd4hep_debug( "${tag} ${sources}") - # - dd4hep_include_directories( "${pkg_incs}" ) - add_definitions ( ${pkg_defs} ) - # - add_library ( ${binary} SHARED ${sources} ) - target_link_libraries ( ${binary} ${pkg_libs} ) - if ( "${${pkg}_VERSION}" STREQUAL "" OR "${${pkg}_SOVERSION}" STREQUAL "" ) - dd4hep_fatal ( "BAD Package versions: VERSION[${pkg}_VERSION] ${${pkg}_VERSION} SOVERSION[${pkg}_SOVERSION] ${${pkg}_SOVERSION} " ) - endif() - ##dd4hep_print ( "set_target_properties ( ${binary} PROPERTIES VERSION ${${pkg}_VERSION} SOVERSION ${${pkg}_SOVERSION})") - set_target_properties ( ${binary} PROPERTIES VERSION ${${pkg}_VERSION} SOVERSION ${${pkg}_SOVERSION}) - # - if ( NOT ${ARG_NOINSTALL} ) - install ( TARGETS ${binary} - LIBRARY DESTINATION lib - RUNTIME DESTINATION bin) - endif() - set ( building_binary "ON" ) - else() - dd4hep_print ( "|++> ${tag} Skipped. No sources to be compiled [Use constraint]" ) - endif() - endif() - endif() - set ( ${building} ${building_binary} PARENT_SCOPE ) -endfunction(dd4hep_add_library) - #--------------------------------------------------------------------------------------------------- # dd4hep_add_regular_library # @@ -1144,59 +893,6 @@ function( dd4hep_add_package_library library ) endif() endfunction(dd4hep_add_package_library) -#--------------------------------------------------------------------------------------------------- -# -# dd4hep_add_plugin -# -# Arguments -# --------- -# binary -> plugin name -# SOURCES -> list of source files. Will be expanded to absolute names -# -# The following variables EXTEND the package defaults -# INCLUDE_DIRS -> Additional include directories need to compile the binary -# LINK_LIBRARIES -> Additional libraries needed to link the binary -# USES -> Required package dependencies -# OPTIONAL -> Optional package dependency -# if required e.g. [LCIO REQUIRED SOURCES aaa.cpp] the plugin will NOT be built -# else e.g. [LCIO SOURCES aaa.cpp] the plugin will be built, but -# the source files will be omitted. -# DEFINITIONS -> Optional compiler definitions to compile the sources -# -# \author M.Frank -# \version 1.0 -# -#--------------------------------------------------------------------------------------------------- -function( dd4hep_add_plugin binary ) - dd4hep_package_properties( pkg PKG enabled ) - set ( tag "Plugin[${pkg}] -> ${binary}" ) - if ( NOT "${enabled}" ) - dd4hep_skipmsg ( "${tag} DISBALED -- package is not built!" ) - else() - cmake_parse_arguments(ARG "NOINSTALL" "" "SOURCES;GENERATED;LINK_LIBRARIES;INCLUDE_DIRS;USES;OPTIONAL;DEFINITIONS" ${ARGN}) - if ( ${ARG_NOINSTALL} ) - set(NOINSTALL NOINSTALL) - endif() - get_property(pkg_lib GLOBAL PROPERTY ${PKG}_LIBRARIES ) - dd4hep_add_library( ${binary} building - PRINT ${tag} - SOURCES ${ARG_SOURCES} - GENERATED ${ARG_GENERATED} - LINK_LIBRARIES ${ARG_LINK_LIBRARIES} ${pkg_lib} - INCLUDE_DIRS ${ARG_INCLUDE_DIRS} - USES ${ARG_USES} - OPTIONAL "${ARG_OPTIONAL}" - DEFINITIONS ${ARG_DEFINITIONS} - ${NOINSTALL} - ) - # - # Generate ROOTMAP if the plugin will be built: - if ( "${building}" ) - dd4hep_generate_rootmap( ${binary} ) - endif() - endif() -endfunction(dd4hep_add_plugin) - #--------------------------------------------------------------------------------------------------- # dd4hep_add_executable # @@ -1282,94 +978,94 @@ function ( dd4hep_add_executable binary ) endif() endfunction(dd4hep_add_executable) -#--------------------------------------------------------------------------------------------------- -# dd4hep_add_dictionary -# -# -# \author M.Frank -# \version 1.0 -# -#--------------------------------------------------------------------------------------------------- -function( dd4hep_add_dictionary dictionary ) - dd4hep_package_properties( pkg PKG enabled ) - set ( tag "Dictionary[${pkg}] -> ${dictionary}" ) - if ( NOT "${enabled}" ) - dd4hep_skipmsg ( "${tag} DISBALED -- package is not built!" ) - else() - cmake_parse_arguments(ARG "" "" "SOURCES;EXCLUDE;LINKDEF;OPTIONS;OPTIONAL;INCLUDES;OUTPUT" ${ARGN} ) - dd4hep_print ( "|++> ${tag} Building dictionary ..." ) - if("${ARG_LINKDEF}" STREQUAL "") - set(ARG_LINKDEF "${CMAKE_SOURCE_DIR}/DDCore/include/ROOT/LinkDef.h") - endif() - # - if ( NOT "${ARG_OPTIONAL}" STREQUAL "" ) - dd4hep_handle_optional_sources ( ${tag} "${ARG_OPTIONAL}" optional_missing optional_uses optional_sources ) - endif() - # - if ( NOT "${optional_missing}" STREQUAL "" ) - dd4hep_print ( "|++> ${tag} SKIPPED. Missing optional dependencies: ${optional_missing}" ) - else() - set ( uses ${ARG_USES} ${optional_uses} ) - dd4hep_use_package ( ${tag} PACKAGE LOCAL - USES "${uses}" - OPTIONAL "${ARG_OPTIONAL}" ) - endif() - if ( NOT "${LOCAL_MISSING}" STREQUAL "" ) - dd4hep_print ( "|++> ${tag} skipped. Missing dependency: ${missing} --> FATAL ERROR. Build should fail!" ) - endif() - # - get_property(incs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY PACKAGE_INCLUDE_DIRS) - get_property(defs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS) - get_property(opts DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS) - dd4hep_make_unique_list( incs VALUES ${LOCAL_INCLUDE_DIRS} ${incs} ) - dd4hep_make_unique_list( defs VALUES ${LOCAL_DEFINITIONS} ${defs} ) - # - file( GLOB headers ${ARG_SOURCES} ) - file( GLOB excl_headers ${ARG_EXCLUDE} ) - foreach( f ${excl_headers} ) - list( REMOVE_ITEM headers ${f} ) - dd4hep_print ( "|++ exclude: ${f}" ) - endforeach() - # - set ( inc_dirs -I${CMAKE_CURRENT_SOURCE_DIR}/include ) - foreach ( inc ${ARG_INCLUDES} ) - set ( inc_dirs ${inc_dirs} -I${inc} ) - endforeach() - foreach ( inc ${incs} ) - file ( GLOB inc ${inc} ) - set ( inc_dirs ${inc_dirs} -I${inc} ) - endforeach() - # - file ( GLOB linkdefs ${ARG_LINKDEF} ) - # - set ( comp_defs ) - foreach ( def ${defs} ) - set ( comp_defs ${comp_defs} -D${def} ) - endforeach() - # - dd4hep_make_unique_list ( sources VALUES ${headers} ) - dd4hep_make_unique_list ( linkdefs VALUES ${linkdefs} ) - dd4hep_make_unique_list ( inc_dirs VALUES ${inc_dirs} ) - dd4hep_make_unique_list ( comp_defs VALUES ${comp_defs} ) - # - dd4hep_debug ( "${tag} Linkdef: '${linkdefs}'" ) - dd4hep_debug ( "${tag} Compile: '${comp_defs};${inc_dirs}'" ) - dd4hep_debug ( "${tag} Files: '${headers}'" ) - dd4hep_debug ( "${tag} Unparsed:'${ARG_UNPARSED_ARGUMENTS}'" ) - dd4hep_debug ( "${tag} Sources: '${CMAKE_CURRENT_SOURCE_DIR}'" ) - # - set ( output_dir ${CMAKE_CURRENT_BINARY_DIR}/../lib ) - if ( NOT "${ARG_OUTPUT}" STREQUAL "" ) - set ( output_dir ${ARG_OUTPUT} ) - endif() - add_custom_command(OUTPUT ${dictionary}.cxx - COMMAND ${ROOT_rootcling_CMD} -cint -f ${dictionary}.cxx - -s ${output_dir}/${dictionary} -inlineInputHeader -c -p ${ARG_OPTIONS} ${comp_defs} -std=c++${CMAKE_CXX_STANDARD} ${inc_dirs} ${headers} ${linkdefs} - DEPENDS ${headers} ${linkdefs} ) - # Install the binary to the destination directory - install(FILES ${output_dir}/${dictionary}_rdict.pcm DESTINATION lib) - endif() -endfunction() +# #--------------------------------------------------------------------------------------------------- +# # dd4hep_add_dictionary +# # +# # +# # \author M.Frank +# # \version 1.0 +# # +# #--------------------------------------------------------------------------------------------------- +# function( dd4hep_add_dictionary dictionary ) +# dd4hep_package_properties( pkg PKG enabled ) +# set ( tag "Dictionary[${pkg}] -> ${dictionary}" ) +# if ( NOT "${enabled}" ) +# dd4hep_skipmsg ( "${tag} DISBALED -- package is not built!" ) +# else() +# cmake_parse_arguments(ARG "" "" "SOURCES;EXCLUDE;LINKDEF;OPTIONS;OPTIONAL;INCLUDES;OUTPUT" ${ARGN} ) +# dd4hep_print ( "|++> ${tag} Building dictionary ..." ) +# if("${ARG_LINKDEF}" STREQUAL "") +# set(ARG_LINKDEF "${CMAKE_SOURCE_DIR}/DDCore/include/ROOT/LinkDef.h") +# endif() +# # +# if ( NOT "${ARG_OPTIONAL}" STREQUAL "" ) +# dd4hep_handle_optional_sources ( ${tag} "${ARG_OPTIONAL}" optional_missing optional_uses optional_sources ) +# endif() +# # +# if ( NOT "${optional_missing}" STREQUAL "" ) +# dd4hep_print ( "|++> ${tag} SKIPPED. Missing optional dependencies: ${optional_missing}" ) +# else() +# set ( uses ${ARG_USES} ${optional_uses} ) +# dd4hep_use_package ( ${tag} PACKAGE LOCAL +# USES "${uses}" +# OPTIONAL "${ARG_OPTIONAL}" ) +# endif() +# if ( NOT "${LOCAL_MISSING}" STREQUAL "" ) +# dd4hep_print ( "|++> ${tag} skipped. Missing dependency: ${missing} --> FATAL ERROR. Build should fail!" ) +# endif() +# # +# get_property(incs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY PACKAGE_INCLUDE_DIRS) +# get_property(defs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_DEFINITIONS) +# get_property(opts DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY COMPILE_OPTIONS) +# dd4hep_make_unique_list( incs VALUES ${LOCAL_INCLUDE_DIRS} ${incs} ) +# dd4hep_make_unique_list( defs VALUES ${LOCAL_DEFINITIONS} ${defs} ) +# # +# file( GLOB headers ${ARG_SOURCES} ) +# file( GLOB excl_headers ${ARG_EXCLUDE} ) +# foreach( f ${excl_headers} ) +# list( REMOVE_ITEM headers ${f} ) +# dd4hep_print ( "|++ exclude: ${f}" ) +# endforeach() +# # +# set ( inc_dirs -I${CMAKE_CURRENT_SOURCE_DIR}/include ) +# foreach ( inc ${ARG_INCLUDES} ) +# set ( inc_dirs ${inc_dirs} -I${inc} ) +# endforeach() +# foreach ( inc ${incs} ) +# file ( GLOB inc ${inc} ) +# set ( inc_dirs ${inc_dirs} -I${inc} ) +# endforeach() +# # +# file ( GLOB linkdefs ${ARG_LINKDEF} ) +# # +# set ( comp_defs ) +# foreach ( def ${defs} ) +# set ( comp_defs ${comp_defs} -D${def} ) +# endforeach() +# # +# dd4hep_make_unique_list ( sources VALUES ${headers} ) +# dd4hep_make_unique_list ( linkdefs VALUES ${linkdefs} ) +# dd4hep_make_unique_list ( inc_dirs VALUES ${inc_dirs} ) +# dd4hep_make_unique_list ( comp_defs VALUES ${comp_defs} ) +# # +# dd4hep_debug ( "${tag} Linkdef: '${linkdefs}'" ) +# dd4hep_debug ( "${tag} Compile: '${comp_defs};${inc_dirs}'" ) +# dd4hep_debug ( "${tag} Files: '${headers}'" ) +# dd4hep_debug ( "${tag} Unparsed:'${ARG_UNPARSED_ARGUMENTS}'" ) +# dd4hep_debug ( "${tag} Sources: '${CMAKE_CURRENT_SOURCE_DIR}'" ) +# # +# set ( output_dir ${CMAKE_CURRENT_BINARY_DIR}/../lib ) +# if ( NOT "${ARG_OUTPUT}" STREQUAL "" ) +# set ( output_dir ${ARG_OUTPUT} ) +# endif() +# add_custom_command(OUTPUT ${dictionary}.cxx +# COMMAND ${ROOT_rootcling_CMD} -cint -f ${dictionary}.cxx +# -s ${output_dir}/${dictionary} -inlineInputHeader -c -p ${ARG_OPTIONS} ${comp_defs} -std=c++${CMAKE_CXX_STANDARD} ${inc_dirs} ${headers} ${linkdefs} +# DEPENDS ${headers} ${linkdefs} ) +# # Install the binary to the destination directory +# install(FILES ${output_dir}/${dictionary}_rdict.pcm DESTINATION lib) +# endif() +# endfunction() #--------------------------------------------------------------------------------------------------- # @@ -1519,26 +1215,39 @@ endfunction() #--------------------------------------------------------------------------------------------------- -# new_dd4hep_add_dictionary +# dd4hep_add_dictionary # +# Arguments +# --------- +# dictionary -> dictionary name +# SOURCES -> Globbing expression to find source files +# EXCLUDE -> Files to exclude if they are found via SOURCES +# LINKDEF -> Last entry when calling rootcling +# USES -> Libraries needed to link the binary +# +# OPTIONS -> Options to pass to rootcling +# INCLUDES -> Additional include directories need to compile the binary +# DEFINITIONS -> Additional compiler definitions to compile the sources +# OUTPUT -> # # \author A.Sailer # \version 1.0 # #--------------------------------------------------------------------------------------------------- -function( new_dd4hep_add_dictionary dictionary ) - cmake_parse_arguments(ARG "" "" "SOURCES;EXCLUDE;LINKDEF;OPTIONS;OPTIONAL;DEPENDS;DEFINITIONS;INCLUDES;OUTPUT" ${ARGN} ) +function(dd4hep_add_dictionary dictionary ) + cmake_parse_arguments(ARG "" "" "SOURCES;EXCLUDE;LINKDEF;OPTIONS;USES;DEFINITIONS;INCLUDES;OUTPUT" ${ARGN} ) dd4hep_print ( "|++> Building dictionary ... ${dictionary}" ) - # if ( NOT "${ARG_OPTIONAL}" STREQUAL "" ) - # dd4hep_handle_optional_sources ( ${tag} "${ARG_OPTIONAL}" optional_missing optional_uses optional_sources ) - # endif() file(GLOB headers ${ARG_SOURCES}) file(GLOB excl_headers ${ARG_EXCLUDE}) foreach( f ${excl_headers} ) list( REMOVE_ITEM headers ${f} ) - dd4hep_print ( "|++ exclude: ${f}" ) + dd4hep_debug ( "|++ exclude: ${f}" ) + endforeach() + + foreach( f ${headers} ) + dd4hep_debug ( "|++ ${dictionary} is using: ${f}" ) endforeach() set(inc_dirs ${CMAKE_CURRENT_SOURCE_DIR}/include) @@ -1551,7 +1260,7 @@ function( new_dd4hep_add_dictionary dictionary ) LIST(APPEND comp_defs ${def}) endforeach() - foreach(DEP ${ARG_DEPENDS}) + foreach(DEP ${ARG_USES}) # Get INCLUDE DIRECTORIES from Dependencies LIST(APPEND inc_dirs $<TARGET_PROPERTY:${DEP},INTERFACE_INCLUDE_DIRECTORIES>) # Get COMPILE DEFINITIONS from Dependencies @@ -1574,7 +1283,6 @@ function( new_dd4hep_add_dictionary dictionary ) endif() SET(COMP_DEFS ) - SET(SPACE_I " -I") file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${dictionary}_arguments CONTENT "${ROOT_rootcling_CMD} -cint -f ${dictionary}.cxx -s ${output_dir}/${dictionary} -inlineInputHeader -c -p ${ARG_OPTIONS} -std=c++${CMAKE_CXX_STANDARD} \ $<$<BOOL:${comp_defs}>:-D$<JOIN:${comp_defs}, -D>> \ @@ -1603,41 +1311,48 @@ endfunction() #--------------------------------------------------------------------------------------------------- # -# new_dd4hep_add_plugin +# dd4hep_add_plugin # # Arguments # --------- # binary -> plugin name # SOURCES -> Globbing expression to find source files # GENERATED -> List of source files +# USES -> Libraries needed to link the binary # -# INCLUDE_DIRS -> Additional include directories need to compile the binary -# LINK_LIBRARIES -> Additional libraries needed to link the binary +# INCLUDES -> Additional include directories need to compile the binary # DEFINITIONS -> Optional compiler definitions to compile the sources +# NOINSTALL -> If set do not install the plugin # \author A.Sailer # \version 1.0 # #--------------------------------------------------------------------------------------------------- -function(new_dd4hep_add_plugin binary) - cmake_parse_arguments(ARG "NOINSTALL" "" "SOURCES;GENERATED;LINK_LIBRARIES;INCLUDE_DIRS;DEFINITIONS" ${ARGN}) +function(dd4hep_add_plugin binary) + cmake_parse_arguments(ARG "NOINSTALL" "" "SOURCES;GENERATED;USES;INCLUDES;DEFINITIONS" ${ARGN}) if ( ${ARG_NOINSTALL} ) set(NOINSTALL NOINSTALL) endif() file(GLOB SOURCES ${ARG_SOURCES}) - ADD_LIBRARY(${binary} SHARED ${SOURCES} ${ARG_GENERATED}) - TARGET_LINK_LIBRARIES(${binary} PUBLIC ${ARG_LINK_LIBRARIES}) - TARGET_INCLUDE_DIRECTORIES(${binary} PUBLIC ${ARG_INCLUDE_DIRS}) - TARGET_COMPILE_DEFINITIONS(${binary} PUBLIC ${ARG_DEFINITIONS}) - # what do these options mean? - #NOINSTALL - # Generate ROOTMAP if the plugin will be built: - dd4hep_generate_rootmap( ${binary} ) -endfunction(new_dd4hep_add_plugin) - - + add_library(${binary} SHARED ${SOURCES} ${ARG_GENERATED}) + target_link_libraries(${binary} PUBLIC ${ARG_USES}) + target_include_directories(${binary} PUBLIC ${ARG_INCLUDES}) + target_compile_definitions(${binary} PUBLIC ${ARG_DEFINITIONS}) + dd4hep_generate_rootmap(${binary}) + if(NOT ${ARG_NOINSTALL}) + set(install_destination "lib") + if(CMAKE_INSTALL_LIBDIR) + set(install_destination ${CMAKE_INSTALL_LIBDIR}) + endif() + install(TARGETS ${binary} LIBRARY DESTINATION ${install_destination}) + endif() +endfunction(dd4hep_add_plugin) +# +# Macro to set up ROOT:: targets so that we can use the same code for root 6.8 and for root 6.10 and beyond +# This is called in dd4hep, and in DD4hepConfig +# macro(DD4HEP_SETUP_ROOT_TARGETS) #ROOT CXX Flags are a string with quotes, not a list, so we need to convert to a list... @@ -1653,16 +1368,8 @@ macro(DD4HEP_SETUP_ROOT_TARGETS) ) # there is also no dependency between the targets TARGET_LINK_LIBRARIES(ROOT::Core INTERFACE Core) - #foreach(LIB Core RIO Net Hist Graf Graf3d Gpad Tree Rint Postscript Matrix Physics MathCore Thread MultiProc) - # MESSAGE(STATUS "ROOT lib location ${LIB} ${ROOT_${LIB}_LIBRARY}") - # SET_TARGET_PROPERTIES(ROOT::${LIB} - # PROPERTIES - # INTERFACE_COMPILE_OPTIONS "${ROOT_CXX_FLAGS}" - # INTERFACE_INCLUDE_DIRECTORIES ${ROOT_INCLUDE_DIRS} - # IMPORTED_LOCATION ${ROOT_${LIB}_LIBRARY} - # ) - #endforeach() - # Non-standard ROOT components we need later on, we "import" them by hand for now + # we list here the targets we use in dd4hep, as later versions of root have the namespace, we do not have to to this + # for ever 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) @@ -1671,14 +1378,17 @@ macro(DD4HEP_SETUP_ROOT_TARGETS) endforeach() ENDIF(NOT TARGET ROOT::Core) - MESSAGE(STATUS "ROOT Libraries ${ROOT_LIBRARIES}") - MESSAGE(STATUS "ROOT CXX_FLAGS ${ROOT_CXX_FLAGS}") - MESSAGE(STATUS "ROOT INCL DIRS ${ROOT_INCLUDE_DIRS}") - MESSAGE(STATUS "ROOT_VERSION: ${ROOT_VERSION}" ) + dd4hep_debug("ROOT Libraries ${ROOT_LIBRARIES}") + dd4hep_debug("ROOT CXX_FLAGS ${ROOT_CXX_FLAGS}") + dd4hep_debug("ROOT INCL DIRS ${ROOT_INCLUDE_DIRS}") + dd4hep_debug("ROOT_VERSION: ${ROOT_VERSION}" ) ENDMACRO() - +# +# Do some processing of the imported Geant4 Targets, CLHEP treatment etc. +# Will only be done once, repeated calls should have no effect +# MACRO(DD4HEP_SETUP_GEANT4_TARGETS) # only do this once @@ -1690,27 +1400,27 @@ MACRO(DD4HEP_SETUP_GEANT4_TARGETS) ENDIF() if(Geant4_builtin_clhep_FOUND) - MESSAGE("STATUS: Using Geant4 internal CLHEP") + dd4hep_debug("Using Geant4 internal CLHEP") set(CLHEP "") else() IF(NOT TARGET CLHEP::CLHEP) FIND_PACKAGE(CLHEP REQUIRED) ENDIF() set(CLHEP CLHEP::CLHEP) - MESSAGE("STATUS: Using External CLHEP") - MESSAGE(STATUS "CLHEP Libraries ${CLHEP_LIBRARIES}") - MESSAGE(STATUS "CLHEP CXX_FLAGS ${CLHEP_CXX_FLAGS}") - MESSAGE(STATUS "CLHEP INCL DIRS ${CLHEP_INCLUDE_DIRS}") - MESSAGE(STATUS "CLHEP_VERSION: ${CLHEP_VERSION}" ) + dd4hep_debug("Using External CLHEP") + dd4hep_debug("CLHEP Libraries ${CLHEP_LIBRARIES}") + dd4hep_debug("CLHEP CXX_FLAGS ${CLHEP_CXX_FLAGS}") + dd4hep_debug("CLHEP INCL DIRS ${CLHEP_INCLUDE_DIRS}") + dd4hep_debug("CLHEP_VERSION: ${CLHEP_VERSION}" ) endif() - MESSAGE(STATUS "Geant4 Libraries ${Geant4_LIBRARIES}") - MESSAGE(STATUS "Geant4 CXX_FLAGS ${Geant4_CXX_FLAGS}") - MESSAGE(STATUS "Geant4 INCL DIRS ${Geant4_INCLUDE_DIRS}") - MESSAGE(STATUS "Geant4_VERSION: ${Geant4_VERSION}" ) + dd4hep_debug("Geant4 Libraries ${Geant4_LIBRARIES}") + dd4hep_debug("Geant4 CXX_FLAGS ${Geant4_CXX_FLAGS}") + dd4hep_debug("Geant4 INCL DIRS ${Geant4_INCLUDE_DIRS}") + dd4hep_debug("Geant4_VERSION: ${Geant4_VERSION}" ) - # Geant4::10.2.2 at least, not in 10.5 (check where it switches) # Geant4 CXX Flags are a string with quotes, not a list, so we need to convert to a list... + # Geant4::10.2.2 at least, not in 10.5 (check where it switches) string(REPLACE " " ";" Geant4_Flags ${Geant4_CXX_FLAGS} ${Geant4_CXX_FLAGS_${CMAKE_BUILD_TYPE}}) SET(Geant4_CXX_FLAGS ${Geant4_Flags}) @@ -1723,9 +1433,6 @@ MACRO(DD4HEP_SETUP_GEANT4_TARGETS) SET(Geant4_DEFINITIONS ${G4_DEF_TEMP}) UNSET(G4_DEF_TEMP) - #get_filename_component(Geant4_LOCATION ${Geant4_INCLUDE_DIRS} DIRECTORY) - #SET(Geant4_LOCATION "/cvmfs/ilc.desy.de/sw/x86_64_gcc49_sl6/geant4/10.03.p02/lib64") - ADD_LIBRARY(Geant4::Interface INTERFACE IMPORTED GLOBAL) SET_TARGET_PROPERTIES(Geant4::Interface @@ -1736,35 +1443,29 @@ MACRO(DD4HEP_SETUP_GEANT4_TARGETS) ) IF(CLHEP) - MESSAGE(STATUS "Adding CLHEP to Geant4::Interface Dependencies") + dd4hep_debug("Adding CLHEP to Geant4::Interface Dependencies") TARGET_LINK_LIBRARIES(Geant4::Interface INTERFACE ${CLHEP}) ENDIF() - #Geant4_LIBRARIES are imported targets, we just add them all to our own interface library for convenience - #Geant4 Libraries to not (yet) use a namespace + # Geant4_LIBRARIES are imported targets, we just add them all to our own interface library for convenience + # Geant4 Libraries do not (yet) use a namespace foreach(LIB ${Geant4_LIBRARIES}) - #ADD_LIBRARY(Geant4::${LIB} SHARED IMPORTED GLOBAL) - # MESSAGE(STATUS "Geant4 lib location ${LIB} ${G4_LIB_TEMP_${LIB}}") - # SET_TARGET_PROPERTIES(Geant4::${LIB} - # PROPERTIES - # INTERFACE_COMPILE_OPTIONS "${Geant4_CXX_FLAGS}" - # INTERFACE_COMPILE_DEFINITIONS "${Geant4_DEFINITIONS}" - # INTERFACE_INCLUDE_DIRECTORIES "${Geant4_INCLUDE_DIRS}" - # IMPORTED_LOCATION ${G4_LIB_TEMP_${LIB}} - # ) TARGET_LINK_LIBRARIES(Geant4::Interface INTERFACE ${LIB}) endforeach() - MESSAGE(STATUS "Geant4 Libraries ${Geant4_LIBRARIES};${Geant4_COMPONENT_LIBRARIES}") - MESSAGE(STATUS "Geant4 Location ${Geant4_LOCATION}") - MESSAGE(STATUS "Geant4 Defintitions ${Geant4_DEFINITIONS}") - MESSAGE(STATUS "Geant4 CXX_FLAGS ${Geant4_CXX_FLAGS}") - MESSAGE(STATUS "Geant4 INCL DIRS ${Geant4_INCLUDE_DIRS}") - MESSAGE(STATUS "Geant4_VERSION: ${Geant4_VERSION}" ) + dd4hep_debug("Geant4 Libraries ${Geant4_LIBRARIES};${Geant4_COMPONENT_LIBRARIES}") + dd4hep_debug("Geant4 Location ${Geant4_LOCATION}") + dd4hep_debug("Geant4 Defintitions ${Geant4_DEFINITIONS}") + dd4hep_debug("Geant4 CXX_FLAGS ${Geant4_CXX_FLAGS}") + dd4hep_debug("Geant4 INCL DIRS ${Geant4_INCLUDE_DIRS}") + dd4hep_debug("Geant4_VERSION: ${Geant4_VERSION}" ) ENDIF() ENDMACRO() +# +# Create Interface library for LCIO +# MACRO(DD4HEP_SETUP_LCIO_TARGETS) IF(NOT TARGET LCIO::LCIO) ADD_LIBRARY(LCIO::LCIO INTERFACE IMPORTED GLOBAL) diff --git a/examples/AlignDet/CMakeLists.txt b/examples/AlignDet/CMakeLists.txt index ea7d7bdde785712e9223530c60e257accd96dee0..e55ffff19176a775b92373413a9f71a1797145a9 100644 --- a/examples/AlignDet/CMakeLists.txt +++ b/examples/AlignDet/CMakeLists.txt @@ -26,7 +26,7 @@ link_libraries(ROOT::Core ROOT::Geom ROOT::GenVector ROOT::MathCore DD4hep::DDAlign ) set(AlignDet_INSTALL ${CMAKE_INSTALL_PREFIX}/examples/AlignDet) -new_dd4hep_add_plugin(AlignDetExample SOURCES src/*.cpp) +dd4hep_add_plugin(AlignDetExample SOURCES src/*.cpp) dd4hep_install_dir(compact DESTINATION ${AlignDet_INSTALL}) dd4hep_configure_scripts(AlignDet DEFAULT_SETUP WITH_TESTS) install(TARGETS AlignDetExample LIBRARY DESTINATION lib) diff --git a/examples/ClientTests/CMakeLists.txt b/examples/ClientTests/CMakeLists.txt index f4fcbf381a3dc6e8ff9f77a42e3ef0eb276ce903..4c25334c3e944c23512c7f91468b85cf836eb75c 100644 --- a/examples/ClientTests/CMakeLists.txt +++ b/examples/ClientTests/CMakeLists.txt @@ -29,7 +29,7 @@ if(TARGET Boost::boost) SET(CT_BOOST_SOURCES src_boost/*.cpp) set(CT_BOOST_LIB Boost::boost) endif() -new_dd4hep_add_plugin(ClientTests SOURCES src/*.cpp ${CT_BOOST_SOURCES}) +dd4hep_add_plugin(ClientTests SOURCES src/*.cpp ${CT_BOOST_SOURCES}) target_link_libraries(ClientTests ${CT_BOOST_LIB}) install(TARGETS ClientTests LIBRARY DESTINATION lib) diff --git a/examples/Conditions/CMakeLists.txt b/examples/Conditions/CMakeLists.txt index 0286f5b7b27f5fa26f997ca9cfb6cf0e71dd7651..b7e4fc1b0dbfe5f0c5d58047ac30e1804eb31640 100644 --- a/examples/Conditions/CMakeLists.txt +++ b/examples/Conditions/CMakeLists.txt @@ -30,7 +30,7 @@ link_libraries(ROOT::Core ROOT::Geom ROOT::GenVector # OPTIONAL XERCESC # ) #----------------------------------------------------------------------------------- -new_dd4hep_add_plugin(ConditionsExample SOURCES src/*.cpp) +dd4hep_add_plugin(ConditionsExample SOURCES src/*.cpp) install(TARGETS ConditionsExample LIBRARY DESTINATION lib) dd4hep_install_dir( xml DESTINATION examples/Conditions ) dd4hep_install_dir( data DESTINATION examples/Conditions ) diff --git a/examples/DDCMS/CMakeLists.txt b/examples/DDCMS/CMakeLists.txt index 4e0e64f40ca9537a4cc551a62a700fb31a3c592c..5fe491e99136814a57a07acc0160dbba2bd6437a 100644 --- a/examples/DDCMS/CMakeLists.txt +++ b/examples/DDCMS/CMakeLists.txt @@ -54,9 +54,8 @@ endif() # If need arises, this can be changed easily. # #---DDCMS plugin library ------------------------------------------------------- -new_dd4hep_add_plugin ( DDCMS SOURCES src/*.cpp src/plugins/*.cpp - LINK_LIBRARIES DD4hep::DDCore DD4hep::DDAlign DD4hep::DDCond - ROOT::Core ROOT::Geom ROOT::GenVector +dd4hep_add_plugin ( DDCMS SOURCES src/*.cpp src/plugins/*.cpp + USES DD4hep::DDCore DD4hep::DDAlign DD4hep::DDCond ROOT::Core ROOT::Geom ROOT::GenVector ) install(TARGETS DDCMS LIBRARY DESTINATION lib) target_include_directories(DDCMS PUBLIC include) diff --git a/examples/DDCodex/CMakeLists.txt b/examples/DDCodex/CMakeLists.txt index 4e967947145be25c0feca731f1747be00db11479..2fd8ab8ffa46f23dcbb93294664307b73729d553 100755 --- a/examples/DDCodex/CMakeLists.txt +++ b/examples/DDCodex/CMakeLists.txt @@ -12,9 +12,9 @@ cmake_minimum_required(VERSION 3.3 FATAL_ERROR) include ( ${DD4hep_DIR}/cmake/DD4hep.cmake ) #---DDCodex plugin library ------------------------------------------------------- -new_dd4hep_add_plugin(DDCodexPlugins +dd4hep_add_plugin(DDCodexPlugins SOURCES src/*.cpp - LINK_LIBRARIES DD4hep::DDCore ROOT::Core ROOT::Geom ROOT::GenVector + USES DD4hep::DDCore ROOT::Core ROOT::Geom ROOT::GenVector ) install(TARGETS DDCodexPlugins DESTINATION lib) # diff --git a/examples/DDDB/CMakeLists.txt b/examples/DDDB/CMakeLists.txt index cb0a2942beb42e0db3eb138be59297f85528270c..68fd85e7b7d79df7d6b76ff151efb89273e71600 100644 --- a/examples/DDDB/CMakeLists.txt +++ b/examples/DDDB/CMakeLists.txt @@ -48,10 +48,7 @@ target_include_directories(DDDB ) #---DDDB plugin library ------------------------------------------------------- -new_dd4hep_add_plugin(DDDBPlugins - SOURCES src/plugins/*.cpp - LINK_LIBRARIES DDDB - ) +dd4hep_add_plugin(DDDBPlugins SOURCES src/plugins/*.cpp USES DDDB) install(TARGETS DDDB DDDBPlugins LIBRARY DESTINATION lib) #---Package installation procedure(s) ----------------------------------------- diff --git a/examples/DDDigi/CMakeLists.txt b/examples/DDDigi/CMakeLists.txt index 0911c47efe980f7e4b3a68e2f4b7c0ba188ce102..5320c760971ef3c74082b634524991cac4815472 100644 --- a/examples/DDDigi/CMakeLists.txt +++ b/examples/DDDigi/CMakeLists.txt @@ -19,7 +19,7 @@ set(DDDigiexamples_INSTALL ${CMAKE_INSTALL_PREFIX}/examples/DDDigi) # dd4hep_set_compiler_flags() # -new_dd4hep_add_plugin(DDDigiExampleLib SOURCES src/*.cpp ) +dd4hep_add_plugin(DDDigiExampleLib SOURCES src/*.cpp ) target_link_libraries(DDDigiExampleLib Boost::boost ROOT::Geom ROOT::GenVector ROOT::RIO) install(TARGETS DDDigiExampleLib LIBRARY DESTINATION lib) install(DIRECTORY scripts DESTINATION ${DDDigiexamples_INSTALL}) diff --git a/examples/DDG4/CMakeLists.txt b/examples/DDG4/CMakeLists.txt index 95f86939526a59e1e3bbb91b4afbd8da71d5291d..9617ea939af921f58fef9ec526fea47bafe75a00 100644 --- a/examples/DDG4/CMakeLists.txt +++ b/examples/DDG4/CMakeLists.txt @@ -24,17 +24,16 @@ if (DD4HEP_USE_GEANT4) dd4hep_set_compiler_flags() # #---- Dictionary of classes to be written to the ROOT file -------------------- - new_dd4hep_add_dictionary(G__DDG4UserDict + dd4hep_add_dictionary(G__DDG4UserDict SOURCES ${DD4hep_DIR}/include/ROOT/Warnings.h src/Dictionary.h LINKDEF ${DD4hep_DIR}/include/ROOT/LinkDef.h OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib ) #---- Example of a client library with user defined plugins -------------------- - new_dd4hep_add_plugin( DDG4UserLib + dd4hep_add_plugin( DDG4UserLib SOURCES src/*.cpp GENERATED G__DDG4UserDict.cxx - LINK_LIBRARIES DD4hep::DDCore DD4hep::DDG4 - Geant4::Interface ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO + USES DD4hep::DDCore DD4hep::DDG4 Geant4::Interface ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO ) install(TARGETS DDG4UserLib LIBRARY DESTINATION lib) # diff --git a/examples/DDG4_MySensDet/CMakeLists.txt b/examples/DDG4_MySensDet/CMakeLists.txt index 349b421df21dd3d304a358443d7c4068026ae47c..88cb04b62760e19480b36c8fdcb3fdc3781fabf4 100644 --- a/examples/DDG4_MySensDet/CMakeLists.txt +++ b/examples/DDG4_MySensDet/CMakeLists.txt @@ -30,17 +30,16 @@ if (DD4HEP_USE_GEANT4) # dd4hep_set_compiler_flags() #--------------------------- Plugin library for the simulation framework --------- - new_dd4hep_add_dictionary(G__DDG4_MySensDet + dd4hep_add_dictionary(G__DDG4_MySensDet SOURCES ${DD4hep_DIR}/include/ROOT/Warnings.h src/MyTrackerHit.h LINKDEF ${DD4hep_DIR}/include/ROOT/LinkDef.h ) #---- Example of a client library with user defined plugins -------------------- - new_dd4hep_add_plugin( DDG4_MySensDet + dd4hep_add_plugin( DDG4_MySensDet GENERATED G__DDG4_MySensDet.cxx SOURCES src/*.cpp - LINK_LIBRARIES Geant4::Interface ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO - DD4hep::DDCore DD4hep::DDG4 + USES Geant4::Interface ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO DD4hep::DDCore DD4hep::DDG4 ) install(TARGETS DDG4_MySensDet DESTINATION lib) diff --git a/examples/LHeD/CMakeLists.txt b/examples/LHeD/CMakeLists.txt index 6a977ef94761b63f524f185bb593913dee9055f6..a0620ab50aa9c2bc9649bde943ed49717a1ba98f 100644 --- a/examples/LHeD/CMakeLists.txt +++ b/examples/LHeD/CMakeLists.txt @@ -23,9 +23,9 @@ dd4hep_install_dir( src compact scripts sim DESTINATION ${LHeDEx_INSTALL} ) set(LIBRARY_OUTPUT_PATH ${PROJECT_BINARY_DIR}/lib) set(EXECUTABLE_OUTPUT_PATH ${PROJECT_BINARY_DIR}/bin) -new_dd4hep_add_plugin(LHeD SOURCES src/*.cpp - LINK_LIBRARIES ROOT::Core ROOT::Geom ROOT::GenVector - DD4hep::DDRec DD4hep::DDCore DD4hep::DDCond DD4hep::DDAlign +dd4hep_add_plugin(LHeD + SOURCES src/*.cpp + USES ROOT::Core ROOT::Geom ROOT::GenVector DD4hep::DDRec DD4hep::DDCore DD4hep::DDCond DD4hep::DDAlign ) if (DD4HEP_USE_GEANT4) diff --git a/examples/Persistency/CMakeLists.txt b/examples/Persistency/CMakeLists.txt index 30dddb30b92b7250f592b6ba97c1c6d9b48d6ac6..b148f353b02ece5439c8e6d7eae1d87c497e6ca9 100644 --- a/examples/Persistency/CMakeLists.txt +++ b/examples/Persistency/CMakeLists.txt @@ -17,7 +17,7 @@ endif() link_libraries(ROOT::Core ROOT::Geom ROOT::GenVector DD4hep::DDCore) #----------------------------------------------------------------------------------- -new_dd4hep_add_plugin(PersistencyExample SOURCES src/*.cpp) +dd4hep_add_plugin(PersistencyExample SOURCES src/*.cpp) install(TARGETS PersistencyExample LIBRARY DESTINATION lib) dd4hep_configure_scripts (Persistency DEFAULT_SETUP WITH_TESTS ) #-------------------------------------------------------------------------- diff --git a/examples/SimpleDetector/CMakeLists.txt b/examples/SimpleDetector/CMakeLists.txt index dd8835cba69991d6dfdf69cd294900b29c4dd63f..2b54a46fdb92da220475596081920b85a0f3a05b 100644 --- a/examples/SimpleDetector/CMakeLists.txt +++ b/examples/SimpleDetector/CMakeLists.txt @@ -18,7 +18,7 @@ endif() link_libraries(ROOT::Core ROOT::Geom ROOT::GenVector DD4hep::DDCore DD4hep::DDRec) -new_dd4hep_add_plugin(SimpleDetector SOURCES src/*.cpp) +dd4hep_add_plugin(SimpleDetector SOURCES src/*.cpp) install(TARGETS SimpleDetector LIBRARY DESTINATION lib) install(DIRECTORY compact DESTINATION examples/ClientTests) #-----------------------------------------------------------------------------------