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_TRACCC)
0106     target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginCovfie)
0107     target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesTraccc)
0108     target_sources(ActsPythonBindings PRIVATE src/Traccc.cpp)
0109 else()
0110     target_sources(ActsPythonBindings PRIVATE src/TracccStub.cpp)
0111 endif()
0112 
0113 if(ACTS_BUILD_PLUGIN_ACTSVG)
0114     target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesIoSvg)
0115     target_sources(ActsPythonBindings PRIVATE src/Svg.cpp)
0116 else()
0117     target_sources(ActsPythonBindings PRIVATE src/SvgStub.cpp)
0118 endif()
0119 
0120 if(ACTS_BUILD_EXAMPLES_PYTHIA8)
0121     target_link_libraries(
0122         ActsPythonBindings
0123         PUBLIC Acts::ExamplesGeneratorsPythia8
0124     )
0125     target_sources(ActsPythonBindings PRIVATE src/Pythia8.cpp)
0126 else()
0127     target_sources(ActsPythonBindings PRIVATE src/Pythia8Stub.cpp)
0128 endif()
0129 
0130 target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesIoHepMC3)
0131 target_sources(ActsPythonBindings PRIVATE src/HepMC3.cpp)
0132 list(APPEND py_files examples/hepmc3/__init__.py)
0133 list(APPEND py_files examples/hepmc3/__main__.py)
0134 
0135 # Symlink hepmc3_normalize.py to build/bin for development
0136 add_custom_target(
0137     hepmc_normalize_symlink
0138     ALL
0139     COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/bin
0140     COMMAND
0141         ${CMAKE_COMMAND} -E create_symlink
0142         ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/examples/hepmc_normalize.py
0143         ${CMAKE_BINARY_DIR}/bin/hepmc_normalize.py
0144     COMMENT "Creating symlink for hepmc_normalize.py"
0145     VERBATIM
0146 )
0147 add_dependencies(hepmc_normalize_symlink ActsExamplesIoHepMC3)
0148 install(
0149     PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/examples/hepmc_normalize.py
0150     DESTINATION ${CMAKE_INSTALL_BINDIR}
0151     RENAME hepmc_normalize.py
0152 )
0153 
0154 if(ACTS_BUILD_EXAMPLES_GNN)
0155     target_link_libraries(
0156         ActsPythonBindings
0157         PUBLIC Acts::ExamplesTrackFindingGnn
0158     )
0159     target_sources(ActsPythonBindings PRIVATE src/GnnTrackFinding.cpp)
0160 else()
0161     target_sources(ActsPythonBindings PRIVATE src/GnnTrackFindingStub.cpp)
0162 endif()
0163 
0164 if(ACTS_BUILD_PLUGIN_ONNX)
0165     target_link_libraries(
0166         ActsPythonBindings
0167         PUBLIC Acts::ExamplesFrameworkML Acts::ExamplesTrackFindingML
0168     )
0169     target_sources(ActsPythonBindings PRIVATE src/Onnx.cpp)
0170     target_sources(ActsPythonBindings PRIVATE src/OnnxNeuralCalibrator.cpp)
0171     list(APPEND py_files examples/onnx/__init__.py)
0172 else()
0173     target_sources(ActsPythonBindings PRIVATE src/OnnxStub.cpp)
0174     target_sources(ActsPythonBindings PRIVATE src/OnnxNeuralCalibratorStub.cpp)
0175 endif()
0176 
0177 if(ACTS_BUILD_PLUGIN_FASTJET)
0178     target_link_libraries(ActsPythonBindings PUBLIC Acts::ExamplesJets)
0179     target_sources(ActsPythonBindings PRIVATE src/TruthJet.cpp)
0180 else()
0181     target_sources(ActsPythonBindings PRIVATE src/TruthJetStub.cpp)
0182 endif()
0183 
0184 if(ACTS_BUILD_EXAMPLES_HASHING)
0185     target_link_libraries(ActsPythonBindings PUBLIC Acts::PluginHashing)
0186     target_sources(ActsPythonBindings PRIVATE src/Hashing.cpp)
0187     list(APPEND py_files examples/hashing.py)
0188 else()
0189     target_sources(ActsPythonBindings PRIVATE src/HashingStub.cpp)
0190 endif()
0191 
0192 foreach(f ${py_files})
0193     set(_target ${_python_dir}/acts/${f})
0194     get_filename_component(_dir ${_target} DIRECTORY)
0195     file(MAKE_DIRECTORY ${_dir})
0196 
0197     file(
0198         CREATE_LINK ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/${f} ${_target}
0199         SYMBOLIC
0200     )
0201 
0202     get_filename_component(_rel ${f} DIRECTORY)
0203 
0204     install(
0205         FILES ${CMAKE_CURRENT_SOURCE_DIR}/python/acts/${f}
0206         DESTINATION ${_python_install_dir}/${_rel}
0207     )
0208 endforeach()