Link to tbb library required - how do I find all lib dependencies?

Sorry, I was using the entry in CMakeVars.txt in the build dir.

I have just found out that by specifying :

export LD_LIBRARY_PATH=/usr/lib64:/usr/lib:/usr/local/lib:/usr/local/lib64

solved the problem. (dirs there contain libtbb and libopencv_*)

Regarding pkg-config: one of its roles is to tell me what libraries to
use, library paths, include paths etc. when compiling code I distribute
to other computers which have an OpenCV not necessarily configured as
mine. I don’t know how to use cmake to enquire these settings. And
frankly I try to keep as far away from cmake as possible, though that’s
personal taste.

So, what’s the best way to enquire these settings with cmake in a
foreign system?