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 DD4hepCylinderLayerStructure
0043 DD4hepCylindricalDetector
0044 DD4hepDetectorElement
0045 DD4hepDiscLayerStructure
0046 DD4hepDetectorSurfaceFactory
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()