How to describe runtime library dependency

In order to use ASAN for our tests, we need to preload a library that defines a no op for dl_close.

My question is now, how do I describe the dependency to this library in CMake best? We have a CMake function that we use to define a test. This defines a executable which is then registered to ctest through Gtest. As I could run any test, the dependency to this no op library needs to be defined in this Cmake function. Is add_dependency the right choice? To build this no op library, we thought of having an additional cmake project to separate dependencies.

Thx for your input!

Since it sounds like purely a runtime thing, add_dependencies sounds like the way to go.