Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/Examples/Python/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 set(_python_dir "${CMAKE_BINARY_DIR}/python")
0002 file(MAKE_DIRECTORY ${_python_dir})
0003 file(MAKE_DIRECTORY ${_python_dir}/acts)
0004 
0005 set(_python_install_dir "python/acts")
0006 
0007 target_sources(
0008     ActsPythonBindings
0009     PRIVATE
0010         src/ModuleEntry.cpp
0011         src/Framework.cpp
0012         src/Alignment.cpp
0013         src/Detector.cpp
0014         src/Digitization.cpp
0015         src/MaterialMapping.cpp
0016         src/ExampleAlgorithms.cpp
0017         src/Output.cpp
0018         src/Input.cpp
0019         src/Propagation.cpp
0020         src/Generators.cpp
0021         src/Obj.cpp
0022         src/TruthTracking.cpp
0023         src/TrackFitting.cpp
0024         src/TrackFinding.cpp
0025         src/Vertexing.cpp
0026         src/AmbiguityResolution.cpp
0027         src/Utilities.cpp
0028 )
0029 
0030 install(TARGETS ActsPythonBindings DESTINATION ${_python_install_dir})
0031 
0032 set_target_properties(
0033     ActsPythonBindings
0034     PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}"
0035 )
0036 set_target_properties(
0037     ActsPythonBindings
0038     PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts
0039 )
0040 
0041 target_link_libraries(
0042     ActsPythonBindings
0043     PUBLIC
0044         Acts::PythonUtilities
0045         Acts::ExamplesFramework
0046         Acts::ExamplesGeometry
0047         Acts::ExamplesDetectorGeneric
0048         Acts::ExamplesDetectorTGeo
0049         Acts::ExamplesIoCsv
0050         Acts::ExamplesIoObj
0051         Acts::ExamplesIoJson
0052         Acts::ExamplesGenerators
0053         Acts::ExamplesPrinters
0054         Acts::ExamplesTrackFinding
0055         Acts::ExamplesTrackFitting
0056         Acts::ExamplesVertexing
0057         Acts::ExamplesFatras
0058         Acts::ExamplesDetectorTelescope
0059         Acts::ExamplesUtilities
0060         Acts::ExamplesAmbiguityResolution
0061         Acts::ExamplesTruthTracking
0062         Acts::ExamplesDigitization
0063         Acts::ExamplesPropagation
0064         Acts::ExamplesMaterialMapping
0065 )
0066 
0067 set(py_files
0068     examples/__init__.py
0069     examples/simulation.py
0070     examples/reconstruction.py
0071     examples/itk.py
0072     examples/odd.py
0073 )
0074 
0075 if(ACTS_BUILD_EXAMPLES_ROOT)
0076     target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesIoRoot)
0077     target_sources(
0078         ActsPythonBindings
0079         PRIVATE src/RootInput.cpp src/RootOutput.cpp
0080     )
0081 else()
0082     target_sources(ActsPythonBindings PRIVATE src/RootStub.cpp)
0083 endif()
0084 
0085 if(ACTS_BUILD_PLUGIN_JSON)
0086     target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginJson)
0087     target_sources(ActsPythonBindings PRIVATE src/Json.cpp)
0088 else()
0089     target_sources(ActsPythonBindings PRIVATE src/JsonStub.cpp)
0090 endif()
0091 
0092 if(ACTS_BUILD_PLUGIN_GEOMODEL)
0093     target_link_libraries(
0094         ActsPythonBindings
0095         PUBLIC
0096             Acts::PluginGeoModel
0097             Acts::ExamplesDetectorGeoModel
0098             Acts::ExamplesMuonSpectrometerMockupDetector
0099     )
0100     target_sources(ActsPythonBindings PRIVATE src/GeoModel.cpp)
0101 else()
0102     target_sources(ActsPythonBindings PRIVATE src/GeoModelStub.cpp)
0103 endif()
0104 
0105 if(ACTS_BUILD_PLUGIN_ROOT)
0106     target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginRoot)
0107     target_sources(ActsPythonBindings PRIVATE src/TGeo.cpp)
0108 else()
0109     target_sources(ActsPythonBindings PRIVATE src/TGeoStub.cpp)
0110 endif()
0111 
0112 if(ACTS_BUILD_PLUGIN_TRACCC)
0113     target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginDetray)
0114     target_sources(ActsPythonBindings PRIVATE src/Detray.cpp)
0115     target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginCovfie)
0116     target_sources(ActsPythonBindings PRIVATE src/Covfie.cpp)
0117     target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesTraccc)
0118     target_sources(ActsPythonBindings PRIVATE src/Traccc.cpp)
0119 else()
0120     target_sources(ActsPythonBindings PRIVATE src/DetrayStub.cpp)
0121     target_sources(ActsPythonBindings PRIVATE src/CovfieStub.cpp)
0122     target_sources(ActsPythonBindings PRIVATE src/TracccStub.cpp)
0123 endif()
0124 
0125 if(ACTS_BUILD_PLUGIN_ACTSVG)
0126     target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesIoSvg)
0127     target_sources(ActsPythonBindings PRIVATE src/Svg.cpp)
0128 else()
0129     target_sources(ActsPythonBindings PRIVATE src/SvgStub.cpp)
0130 endif()
0131 
0132 if(ACTS_BUILD_PLUGIN_DD4HEP AND ACTS_BUILD_EXAMPLES_DD4HEP)
0133     pybind11_add_module(ActsPythonBindingsDD4hep src/DD4hepComponent.cpp)
0134     target_link_libraries(
0135         ActsPythonBindingsDD4hep
0136         PUBLIC Acts::PythonUtilities Acts::ExamplesDetectorDD4hep
0137     )
0138     add_dependencies(ActsPythonBindings ActsPythonBindingsDD4hep)
0139 
0140     install(TARGETS ActsPythonBindingsDD4hep DESTINATION ${_python_install_dir})
0141     set_target_properties(
0142         ActsPythonBindingsDD4hep
0143         PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}"
0144     )
0145     set_target_properties(
0146         ActsPythonBindingsDD4hep
0147         PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts
0148     )
0149     list(APPEND py_files examples/dd4hep.py)
0150 endif()
0151 
0152 if(ACTS_BUILD_EXAMPLES_PYTHIA8)
0153     target_link_libraries(
0154         ActsPythonBindings
0155         PUBLIC Acts::ExamplesGeneratorsPythia8
0156     )
0157     target_sources(ActsPythonBindings PRIVATE src/Pythia8.cpp)
0158 else()
0159     target_sources(ActsPythonBindings PRIVATE src/Pythia8Stub.cpp)
0160 endif()
0161 
0162 if(ACTS_BUILD_EXAMPLES_GEANT4)
0163     pybind11_add_module(ActsPythonBindingsGeant4 src/Geant4Component.cpp)
0164     target_link_libraries(
0165         ActsPythonBindingsGeant4
0166         PUBLIC
0167             Acts::ExamplesGeant4
0168             Acts::ExamplesDetectorGeant4
0169             Acts::PythonUtilities
0170             Acts::ExamplesMuonSpectrometerMockupDetector
0171     )
0172     add_dependencies(ActsPythonBindings ActsPythonBindingsGeant4)
0173 
0174     install(TARGETS ActsPythonBindingsGeant4 DESTINATION ${_python_install_dir})
0175     set_target_properties(
0176         ActsPythonBindingsGeant4
0177         PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}"
0178     )
0179     set_target_properties(
0180         ActsPythonBindingsGeant4
0181         PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts
0182     )
0183     list(APPEND py_files examples/geant4/__init__.py)
0184 endif()
0185 
0186 target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesIoHepMC3)
0187 target_sources(ActsPythonBindings PRIVATE src/HepMC3.cpp)
0188 list(APPEND py_files examples/hepmc3/__init__.py)
0189 list(APPEND py_files examples/hepmc3/__main__.py)
0190 
0191 # Symlink hepmc3_normalize.py to build/bin for development
0192 add_custom_target(
0193     hepmc_normalize_symlink
0194     ALL
0195     COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin
0196     COMMAND
0197         ${CMAKE_COMMAND} -E create_symlink
0198         ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/examples/hepmc_normalize.py
0199         ${CMAKE_BINARY_DIR}/bin/hepmc_normalize.py
0200     COMMENT "Creating symlink for hepmc_normalize.py"
0201     VERBATIM
0202 )
0203 add_dependencies(hepmc_normalize_symlink ActsExamplesIoHepMC3)
0204 install(
0205     PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/examples/hepmc_normalize.py
0206     DESTINATION ${CMAKE_INSTALL_BINDIR}
0207     RENAME hepmc_normalize.py
0208 )
0209 
0210 if(ACTS_BUILD_EXAMPLES_GNN)
0211     target_link_libraries(
0212         ActsPythonBindings
0213         PUBLIC Acts::ExamplesTrackFindingGnn
0214     )
0215     target_sources(ActsPythonBindings PRIVATE src/GnnTrackFinding.cpp)
0216 else()
0217     target_sources(ActsPythonBindings PRIVATE src/GnnTrackFindingStub.cpp)
0218 endif()
0219 
0220 if(ACTS_BUILD_EXAMPLES_EDM4HEP)
0221     pybind11_add_module(ActsPythonBindingsEDM4hep src/EDM4hepComponent.cpp)
0222     target_link_libraries(
0223         ActsPythonBindingsEDM4hep
0224         PUBLIC Acts::PythonUtilities Acts::ExamplesIoEDM4hep
0225     )
0226     add_dependencies(ActsPythonBindings ActsPythonBindingsEDM4hep)
0227     install(
0228         TARGETS ActsPythonBindingsEDM4hep DESTINATION ${_python_install_dir}
0229     )
0230     set_target_properties(
0231         ActsPythonBindingsEDM4hep
0232         PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}"
0233     )
0234     set_target_properties(
0235         ActsPythonBindingsEDM4hep
0236         PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts
0237     )
0238     list(APPEND py_files examples/edm4hep.py)
0239 endif()
0240 
0241 if(ACTS_BUILD_EXAMPLES_PODIO)
0242     pybind11_add_module(ActsPythonBindingsPodio src/PodioComponent.cpp)
0243     target_link_libraries(
0244         ActsPythonBindingsPodio
0245         PUBLIC Acts::PythonUtilities Acts::ExamplesIoPodio
0246     )
0247     add_dependencies(ActsPythonBindings ActsPythonBindingsPodio)
0248     install(TARGETS ActsPythonBindingsPodio DESTINATION ${_python_install_dir})
0249     set_target_properties(
0250         ActsPythonBindingsPodio
0251         PROPERTIES INSTALL_RPATH "\$ORIGIN/../../${CMAKE_INSTALL_LIBDIR}"
0252     )
0253     set_target_properties(
0254         ActsPythonBindingsPodio
0255         PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${_python_dir}/acts
0256     )
0257     list(APPEND py_files examples/podio.py)
0258 endif()
0259 
0260 if(ACTS_BUILD_PLUGIN_ONNX)
0261     target_link_libraries(
0262         ActsPythonBindings
0263         PUBLIC Acts::ExamplesFrameworkML Acts::ExamplesTrackFindingML
0264     )
0265     target_sources(ActsPythonBindings PRIVATE src/Onnx.cpp)
0266     target_sources(ActsPythonBindings PRIVATE src/OnnxNeuralCalibrator.cpp)
0267     list(APPEND py_files examples/onnx/__init__.py)
0268 else()
0269     target_sources(ActsPythonBindings PRIVATE src/OnnxStub.cpp)
0270     target_sources(ActsPythonBindings PRIVATE src/OnnxNeuralCalibratorStub.cpp)
0271 endif()
0272 
0273 if(ACTS_BUILD_PLUGIN_FASTJET)
0274     target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesJets)
0275     target_sources(ActsPythonBindings PRIVATE src/TruthJet.cpp)
0276 else()
0277     target_sources(ActsPythonBindings PRIVATE src/TruthJetStub.cpp)
0278 endif()
0279 
0280 if(ACTS_BUILD_EXAMPLES_HASHING)
0281     target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginHashing)
0282     target_sources(ActsPythonBindings PRIVATE src/Hashing.cpp)
0283     list(APPEND py_files examples/hashing.py)
0284 else()
0285     target_sources(ActsPythonBindings PRIVATE src/HashingStub.cpp)
0286 endif()
0287 
0288 foreach(f ${py_files})
0289     set(_target ${_python_dir}/acts/${f})
0290     get_filename_component(_dir ${_target} DIRECTORY)
0291     file(MAKE_DIRECTORY ${_dir})
0292 
0293     file(
0294         CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/${f} ${_target}
0295         SYMBOLIC
0296     )
0297 
0298     get_filename_component(_rel ${f} DIRECTORY)
0299 
0300     install(
0301         FILES ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/${f}
0302         DESTINATION ${_python_install_dir}/${_rel}
0303     )
0304 endforeach()