Warning, /acts/Tests/UnitTests/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 # add a unittest executable w/ default dependencies and register it.
0002
0003 # the common libraries which are linked to every unittest can be
0004 # extended by setting the `unittest_extra_libraries` variables before
0005 # calling the macro.
0006
0007 add_custom_target(unit_tests)
0008
0009 macro(add_unittest _name _source)
0010 # automatically prefix the target name
0011 set(_target "ActsUnitTest${_name}")
0012 add_executable(${_target} ${_source})
0013 # define required BOOST_TEST_... macros here to ensure consistent names
0014 target_compile_definitions(${_target} PRIVATE "-DBOOST_TEST_DYN_LINK")
0015 set_source_files_properties(
0016 ${_source}
0017 PROPERTIES COMPILE_DEFINITIONS "BOOST_TEST_MODULE=${_target}"
0018 )
0019 target_include_directories(${_target} PRIVATE ${CMAKE_CURRENT_SOURCE_DIR})
0020 target_link_libraries(
0021 ${_target}
0022 PRIVATE
0023 Acts::TestsCommonHelpers
0024 Boost::unit_test_framework
0025 ${unittest_extra_libraries}
0026 )
0027 # register as unittest executable
0028 add_test(NAME ${_name} COMMAND ${_target})
0029 add_dependencies(unit_tests ${_target})
0030 endmacro()
0031
0032 add_subdirectory(Core)
0033 add_subdirectory_if(
0034 Examples
0035 ACTS_BUILD_EXAMPLES
0036 AND
0037 ACTS_BUILD_EXAMPLES_UNITTESTS
0038 )
0039 add_subdirectory_if(Benchmarks ACTS_BUILD_BENCHMARKS)
0040 add_subdirectory_if(Fatras ACTS_BUILD_FATRAS)
0041 add_subdirectory(Plugins)
0042 add_subdirectory_if(Alignment ACTS_BUILD_ALIGNMENT)