diff --git a/src/cmake/Helpers.cmake b/src/cmake/Helpers.cmake index 9c6f192a9c..da341cf1be 100644 --- a/src/cmake/Helpers.cmake +++ b/src/cmake/Helpers.cmake @@ -222,6 +222,11 @@ function(alicevision_add_test test_file) Boost::unit_test_framework Boost::log ) + if(BUILD_SHARED_LIBS) + target_compile_options(${TEST_EXECUTABLE_NAME} + PUBLIC -DBOOST_TEST_DYN_LINK + ) + endif() target_include_directories(${TEST_EXECUTABLE_NAME} PUBLIC ${TEST_INCLUDE_DIRS}