Warning, /DD4hep/DDDigi/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 #==========================================================================
0002 # AIDA Detector description implementation
0003 #--------------------------------------------------------------------------
0004 # Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0005 # All rights reserved.
0006 #
0007 # For the licensing terms see $DD4hepINSTALL/LICENSE.
0008 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0009 #
0010 #==========================================================================
0011 SET_PROPERTY(DIRECTORY . PROPERTY PACKAGE_NAME DDDigi)
0012 file(GLOB DDDigi_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/*.cpp
0013 ${CMAKE_CURRENT_SOURCE_DIR}/src/noise/*.cpp
0014 ${CMAKE_CURRENT_SOURCE_DIR}/src/segmentations/*.cpp)
0015 add_library(DDDigi ${DDDigi_SOURCES})
0016 add_library(DD4hep::DDDigi ALIAS DDDigi)
0017
0018 target_link_libraries(DDDigi PUBLIC
0019 DD4hep::DDCore Boost::boost ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO)
0020
0021 target_include_directories(DDDigi
0022 PUBLIC
0023 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
0024 $<INSTALL_INTERFACE:include>
0025 )
0026 #
0027 if(DD4HEP_USE_TBB)
0028 dd4hep_print( "|++> TBB_IMPORTED_TARGETS --> ${TBB_IMPORTED_TARGETS}")
0029 dd4hep_print( "|++> TBB found. DDDigi will run multi threaded.")
0030 target_compile_definitions(DDDigi PUBLIC DD4HEP_USE_TBB)
0031 target_link_libraries(DDDigi PUBLIC ${TBB_IMPORTED_TARGETS})
0032 else()
0033 dd4hep_print( "|++> TBB not used. DDDigi will only work single threaded.")
0034 endif()
0035 #
0036 #--------------------------- Legacy libraries -------------------------------------
0037 dd4hep_add_dictionary(G__DDDigi
0038 SOURCES ../DDCore/include/ROOT/Warnings.h python/DDDigiDict.C
0039 LINKDEF ../DDCore/include/ROOT/LinkDef.h
0040 USES DD4hep::DDCore ROOT::Core ROOT::Geom ROOT::GenVector ROOT::RIO Boost::boost
0041 )
0042 #--------------------------- Plugin library for the digitization framework -------
0043 dd4hep_add_plugin(DDDigiPlugins
0044 SOURCES plugins/*.cpp
0045 GENERATED G__DDDigi.cxx
0046 USES DD4hep::DDDigi
0047 )
0048 #
0049 #---------------- I/O Plugin library to read/write DDG4 and edm4hep files ---------
0050 set(DDDigiIO_USES "DD4hep::DDDigi;DD4hep::DDCore")
0051 set(DDDigiIO_SOURCES "io/DigiIO.cpp;io/Digi2ROOT.cpp")
0052 set(DDDigiIO_GENERATED)
0053 set(DDDigiIO_DEFINITIONS)
0054 if(DD4HEP_USE_GEANT4)
0055 list(APPEND DDDigiIO_DEFINITIONS "DD4HEP_USE_DDG4=1")
0056 dd4hep_add_dictionary(G__DDDigi_DDG4_IO
0057 SOURCES ../DDCore/include/ROOT/Warnings.h io/DDG4IO.cpp
0058 LINKDEF ../DDCore/include/ROOT/LinkDef.h
0059 USES DD4hep::DDG4 DD4hep::DDCore
0060 DEFINITIONS ${DDDigiIO_DEFINITIONS}
0061 )
0062 list(APPEND DDDigiIO_GENERATED G__DDDigi_DDG4_IO.cxx)
0063 list(APPEND DDDigiIO_SOURCES "io/DDG4IO.cpp;io/DigiDDG4Input.cpp")
0064 list(APPEND DDDigiIO_USES "DD4hep::DDG4")
0065 else()
0066 dd4hep_print( "|++> Geant4 not used. DDDigi will not be able to read DDG4 output.")
0067 endif()
0068 #
0069 if(DD4HEP_USE_EDM4HEP)
0070 list(APPEND DDDigiIO_SOURCES "io/DigiEdm4hepOutput.cpp;io/DigiEdm4hepInput.cpp")
0071 list(APPEND DDDigiIO_DEFINITIONS "DD4HEP_USE_EDM4HEP=1")
0072 if(podio_VERSION VERSION_GREATER_EQUAL "1.0.0")
0073 list(APPEND DDDigiIO_USES "EDM4HEP::edm4hep;EDM4HEP::edm4hepDict;podio::podio;podio::podioDict;podio::podioIO")
0074 else()
0075 list(APPEND DDDigiIO_USES "EDM4HEP::edm4hep;EDM4HEP::edm4hepDict;podio::podio;podio::podioDict;podio::podioRootIO")
0076 endif()
0077 else()
0078 dd4hep_print( "|++> EDM4HEP not used. DDDigi will not be able to write EDM4HEP output.")
0079 endif()
0080 #
0081 list(REMOVE_DUPLICATES DDDigiIO_USES)
0082 dd4hep_add_plugin(DDDigi_IO
0083 SOURCES ${DDDigiIO_SOURCES}
0084 GENERATED ${DDDigiIO_GENERATED}
0085 USES ${DDDigiIO_USES}
0086 DEFINITIONS ${DDDigiIO_DEFINITIONS}
0087 )
0088 set_target_properties(DDDigi_IO PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
0089 #
0090 #---Package installation procedure(s) ----------------------------------------------
0091 set_target_properties(DDDigi DDDigiPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
0092 #
0093 file(GLOB DDDigi_python python/*.py python/*.C)
0094 install(FILES ${DDDigi_python} DESTINATION ${DD4HEP_PYTHON_INSTALL_DIR})
0095 #
0096 install(TARGETS DDDigi EXPORT DD4hep
0097 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
0098 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
0099 )
0100 install(DIRECTORY include/DDDigi DESTINATION include)