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         DD4hepDetectorElement
0045         DD4hepDetectorSurfaceFactory
0046         DD4hepCylindricalDetectorGen3
0047     )
0048     foreach(_test ${dd4hep_tests})
0049         add_unittest(${_test} ${_test}Tests.cpp)
0050         add_dependencies(
0051             ActsUnitTest${_test}
0052             Components_ActsTestsDD4hepFactories
0053         )
0054         if(APPLE)
0055             set_property(
0056                 TEST ${_test}
0057                 PROPERTY
0058                     ENVIRONMENT
0059                         "DYLD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}:$ENV{DYLD_LIBRARY_PATH}"
0060             )
0061         else()
0062             set_property(
0063                 TEST ${_test}
0064                 PROPERTY
0065                     ENVIRONMENT
0066                         "LD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}:$ENV{LD_LIBRARY_PATH}"
0067             )
0068         endif()
0069     endforeach()
0070 else()
0071     message(
0072         WARNING
0073         "DD4hep libraries not found, DD4hep tests will not be built."
0074     )
0075 endif()