Warning, /DD4hep/DDCore/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 #=================================================================================
0002 #
0003 # AIDA Detector description implementation
0004 #---------------------------------------------------------------------------------
0005 # Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
0006 # All rights reserved.
0007 #
0008 # For the licensing terms see $DD4hepINSTALL/LICENSE.
0009 # For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
0010 #
0011 #=================================================================================
0012 #---Generate ROOT dictionary------------------------------------------------------
0013 SET_PROPERTY(DIRECTORY . PROPERTY PACKAGE_NAME DDCore)
0014 dd4hep_print("|++> Will be Building DDCore")
0015
0016 file(GLOB DDCore_SOURCES src/*.cpp src/segmentations/*.cpp src/XML/*.cpp)
0017
0018
0019 # Build the generic DD4hep dictionary
0020 dd4hep_add_dictionary( G__DD4hep
0021 SOURCES include/ROOT/Warnings.h
0022 include/DD4hep/*.h
0023 include/DD4hep/detail/*.h
0024 include/XML/*.h
0025 src/RootDictionary.h
0026 EXCLUDE include/DD4hep/DetFactoryHelper.h
0027 include/DD4hep/Any.h
0028 include/DD4hep/Factories.h
0029 include/DD4hep/Plugins.h
0030 include/DD4hep/IoStreams.h
0031 include/DD4hep/SurfaceInstaller.h
0032 include/DD4hep/GrammarParsed.h
0033 include/DD4hep/GrammarUnparsed.h
0034 include/XML/UnicodeValues.h
0035 include/XML/tinyxml.h
0036 include/XML/tinystring.h
0037 ${EXCLUDE_HEADER}
0038 LINKDEF include/ROOT/LinkDef.h
0039 USES DDCore DDParsers ${XML_LIBRARIES} ${TBB_IMPORTED_TARGETS}
0040 DEFINITIONS DD4HEP_MUST_USE_DETECTORIMP_H
0041 )
0042
0043 # Build the DD4hep dictionary for all geometry instantiations
0044 dd4hep_add_dictionary( G__DD4hepGeo
0045 SOURCES include/ROOT/Warnings.h src/GeoDictionary.h
0046 LINKDEF include/ROOT/LinkDef.h
0047 USES DDCore DDParsers ${XML_LIBRARIES}
0048 )
0049
0050 # Build the DD4hep dictionary for property type instantiations
0051 dd4hep_add_dictionary( G__DD4hepProperties
0052 SOURCES include/ROOT/Warnings.h src/PropertyDictionary.h
0053 LINKDEF include/ROOT/LinkDef.h
0054 USES DDCore DDParsers ${XML_LIBRARIES}
0055 )
0056
0057 # Build the DD4hep dictionary for the segmentation instantiations
0058 dd4hep_add_dictionary( G__DD4hepSegmentations
0059 SOURCES include/ROOT/Warnings.h src/SegmentationDictionary.h
0060 LINKDEF include/ROOT/LinkDef.h
0061 USES DDCore DDParsers ${XML_LIBRARIES}
0062 )
0063
0064 if(TARGET Boost::boost)
0065 dd4hep_print("|++> Boost available, building Json Parsers")
0066 file(GLOB DDCore_BOOST_SOURCES src/JSON/*.cpp)
0067 endif()
0068
0069 add_library(DDCore ${DDCore_SOURCES} ${DDCore_BOOST_SOURCES}
0070 G__DD4hep.cxx
0071 G__DD4hepSegmentations.cxx
0072 G__DD4hepProperties.cxx
0073 G__DD4hepGeo.cxx
0074 )
0075 add_library(DD4hep::DDCore ALIAS DDCore)
0076
0077 if(DD4HEP_USE_TBB)
0078 target_compile_definitions(DDCore PUBLIC DD4HEP_USE_TBB)
0079 target_link_libraries(DDCore PUBLIC TBB::tbb)
0080 endif()
0081
0082 target_include_directories(DDCore
0083 PUBLIC
0084 $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/>
0085 $<INSTALL_INTERFACE:include>
0086 )
0087
0088 target_link_libraries(DDCore
0089 PUBLIC
0090 DD4hep::DDParsers
0091 ROOT::Core ROOT::Rint ROOT::Tree ROOT::Physics ROOT::Geom ROOT::GenVector
0092 ${XML_LIBRARIES} ${CMAKE_DL_LIBS}
0093 )
0094
0095 target_compile_features(DDCore
0096 PUBLIC
0097 cxx_std_${CMAKE_CXX_STANDARD}
0098 )
0099
0100 # Generate DDCore plugins---------------------------------------------------------
0101 dd4hep_add_plugin(DDCorePlugins SOURCES src/plugins/*.cpp USES DDCore)
0102
0103 # Graphics DDCore plugins---------------------------------------------------------
0104 dd4hep_add_plugin(DDCoreGraphics
0105 SOURCES src/graphics/*.cpp
0106 USES DDCore ROOT::Core ROOT::Rint ROOT::Gui ROOT::Hist ROOT::HistPainter)
0107
0108 # This plugins depends on the ROOT GDML readers. Hence, extra library
0109 IF(TARGET ROOT::Gdml)
0110 dd4hep_print("|++> Found Root::GDML: Creating DDGDMLPlugins")
0111 dd4hep_add_plugin(DDGDMLPlugins
0112 SOURCES src/gdml/*.cpp
0113 USES DD4hep::DDCore ROOT::Core ROOT::Gdml
0114 )
0115 set_target_properties(DDGDMLPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
0116 ELSE()
0117 dd4hep_print("ROOT does not include GDML, not building DDCore GDML Plugins")
0118 ENDIF()
0119
0120 #--------------------------- Specialized PYTHON plugin ----------------------------
0121 IF(TARGET ROOT::ROOTTPython)
0122 dd4hep_add_plugin(DDPythonPlugins
0123 SOURCES src/python/*.cpp
0124 USES DDCore ROOT::Core ROOT::ROOTTPython
0125 )
0126 set_target_properties(DDPythonPlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
0127 ELSE()
0128 dd4hep_print("ROOT does not include Python support, not building DDCore DDPython Plugins")
0129 ENDIF()
0130
0131 # install python files
0132 file(GLOB DDCore_Python python/*.py)
0133 install(FILES ${DDCore_Python} DESTINATION ${DD4HEP_PYTHON_INSTALL_DIR})
0134
0135 install(PROGRAMS python/bin/checkOverlaps.py DESTINATION bin RENAME checkOverlaps)
0136 install(PROGRAMS python/bin/checkGeometry.py DESTINATION bin RENAME checkGeometry)
0137
0138 # install header files
0139 install(DIRECTORY
0140 include/DDSegmentation
0141 include/DD4hep
0142 include/XML
0143 include/JSON
0144 include/Parsers
0145 include/ROOT
0146 DESTINATION include
0147 )
0148
0149 set_target_properties(DDCore DDCorePlugins PROPERTIES VERSION ${DD4hep_VERSION} SOVERSION ${DD4hep_SOVERSION})
0150 install(TARGETS DDCore EXPORT DD4hep
0151 ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
0152 LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
0153 )