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