How can I find a library name of .so file?
For example, I have libprofiler.so file. How can I get name of this shared object like this: getname /usr/lib/libprofiler.so I want to do it because it is required for CMakeLists.txt in target_link_libraries(MyProject name_of_library) Th. Thielemann Do the following steps to link an existing lib to your target: Inform you which lib do you need: here profiler. Build the name of the lib. CMake does not really needs this but it is worth to know: Example on Unix/Linux lib + NAME + [.so|.a] [VERSION]. Here: libprofiler.so . In your CMakeLists.txt: find_library(LIB_PROFILER NAMES profiler