Back to home page

sPhenix 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 SHARED
0003     DD4hepTestsHelper.cpp
0004     LayerFactory.cpp
0005     PrimitivesFactory.cpp)
0006 
0007 target_include_directories(
0008     ActsTestsDD4hepFactories
0009     PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
0010 target_link_libraries(
0011     ActsTestsDD4hepFactories PUBLIC ActsPluginDD4hep DD4hep::DDCore)
0012 
0013 # Not sure why this needs to be set, but dd4hep fails to compile otherwise
0014 set(LIBRARY_OUTPUT_PATH ${CMAKE_CURRENT_BINARY_DIR})
0015 set_target_properties(ActsTestsDD4hepFactories PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
0016 dd4hep_set_version(ActsTestsDD4hepFactories MAJOR 1 MINOR 0 PATCH 0)
0017 dd4hep_generate_rootmap(ActsTestsDD4hepFactories)
0018 
0019 find_library(dd4hep_core_library DDCore)
0020 
0021 if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.24.0") 
0022   set(factory_path "$<PATH:GET_PARENT_PATH,$<TARGET_FILE:ActsTestsDD4hepFactories>>")
0023 else()
0024   set(factory_path "${CMAKE_CURRENT_BINARY_DIR}")
0025 endif()
0026 
0027 
0028 if (NOT "${dd4hep_core_library}" STREQUAL "dd4hep_core_library-NOTFOUND")
0029   cmake_path(GET dd4hep_core_library PARENT_PATH DD4HEP_LIBRARY_PATH)
0030   # set test library dependencies
0031   set(unittest_extra_libraries ActsTestsDD4hepFactories ActsPluginDD4hep)
0032   set(dd4hep_tests DD4hepDetectorElement DD4hepCylinderLayerStructure DD4hepDiscLayerStructure DD4hepCylindricalDetector)
0033   foreach(_test ${dd4hep_tests})
0034     add_unittest(${_test} ${_test}Tests.cpp)
0035     add_dependencies(ActsUnitTest${_test} Components_ActsTestsDD4hepFactories)
0036     if(APPLE)
0037       set_property(TEST ${_test} PROPERTY ENVIRONMENT 
0038         "DYLD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}") 
0039     else()
0040       set_property(TEST ${_test} PROPERTY ENVIRONMENT 
0041         "LD_LIBRARY_PATH=${DD4HEP_LIBRARY_PATH}:${factory_path}")
0042     endif()
0043   endforeach()
0044 else()
0045     message(WARNING "DD4hep libraries not found, DD4hep tests will not be built.")
0046 endif()