Library "not found" after building test with CMake on Ubuntu.

I really dont know what solved the issue but both the locate libvtksys & locate libvtk return locations now! Maybe it was the sudo updatedb?
Also the tools of library X started to work. I will restart the system to see if this state is now persistent.

[Edit]
My apps and the tools of library x still work fine after a reboot. I hope that this issue is persistently solved in my case.
Thank you so so much for your quick help @ferdymercury! You really saved me.

Any idea what could have been the problem? So other users with this kind of problem find a quick solution?

I wonder if the library cache is what changed here. The rpath settings could also have been involved. Without more debugging info from before the fix, it’s hard to say exactly. But one can update the cache with sudo ldconfig manually.