Back to home page

EIC code displayed by LXR

 
 

    


Warning, /acts/Tests/UnitTests/Plugins/DD4hep/CMakeLists.txt is written in an unsupported language. File is not indexed.

0001 add_library(
0002     ActsTestsDD4hepFactories
0003     SHARED
0004     DD4hepTestsHelper.cpp
0005     LayerFactory.cpp
0006     PrimitivesFactory.cpp
0007 )
0008 
0009 add_library(Acts::TestsDD4hepFactories ALIAS ActsTestsDD4hepFactories)
0010 
0011 target_include_directories(
0012     ActsTestsDD4hepFactories
0013     PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
0014 )
0015 target_link_libraries(
0016     ActsTestsDD4hepFactories
0017     PUBLIC Acts::PluginDD4hep DD4hep::DDCore
0018 )
0019 
0020 # Not sure why this needs to be set, but dd4hep fails to compile otherwise
0021 set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
0022 set_target_properties(
0023     ActsTestsDD4hepFactories
0024     PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
0025 )
0026 dd4hep_set_version(ActsTestsDD4hepFactories MAJOR 1 MINOR 0 PATCH 0)
0027 dd4hep_generate_rootmap(ActsTestsDD4hepFactories)
0028 
0029 find_library(dd4hep_core_library DDCore)
0030 
0031 if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0")
0032     set(factory_path
0033         "$<PATH:GET_PARENT_PATH,$<TARGET_FILE:Acts::TestsDD4hepFactories>>"
0034     )
0035 else()
0036     set(factory_path "${CMAKE_CURRENT_BINARY_DIR}")
0037 endif()
0038 
0039 if(NOT "${dd4hep_core_library}" STREQUAL "dd4hep_core_library-NOTFOUND")
0040     cmake_path(GET dd4hep_core_library PARENT_PATH DD4HEP_LIBRARY_PATH)
0041     # set test library dependencies
0042     set(unittest_extra_libraries Acts::TestsDD4hepFactories Acts::PluginDD4hep)
0043     set(dd4hep_tests
0044         DD4hepCylinderLayerStructure
0045         DD4hepCylindricalDetector
0046         DD4hepDetectorElement
0047         DD4hepDiscLayerStructure
0048         DD4hepDetectorSurfaceFactory
0049     )
0050     foreach(_test ${dd4hep_tests})
0051         add_unittest(${_test} ${_test}Tests.cpp)
0052         add_dependencies(
0053             ActsUnitTest${_test}
0054             Components_ActsTestsDD4hepFactories
0055         )
0056         if(APPLE)
0057             set_property(
0058                 TEST ${_test}
0059                 PROPERTY
0060                     ENVIRONMENT
0061                         "DYLD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}:$ENV{DYLD_LIBRARY_PATH}"
0062             )
0063         else()
0064             set_property(
0065                 TEST ${_test}
0066                 PROPERTY
0067                     ENVIRONMENT
0068                         "LD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}:$ENV{LD_LIBRARY_PATH}"
0069             )
0070         endif()
0071     endforeach()
0072 else()
0073     message(
0074         WARNING
0075         "DD4hep libraries not found, DD4hep tests will not be built."
0076     )
0077 endif()