4
votes

I working on a C++ application running on Linux. The project uses CMake.

It use a third party shared library. Unfortunately, the third party library doesn't end with .so. And the CMake command find_library can't find the library.

Does anyone now how to force CMake to find libraries with a custom file extension? Or at least, how to configure GCC (through CMake) for linking with the library ending with a custom extension?

Thanks for any hint!

1

1 Answers

1
votes

You can set the CMAKE_FIND_LIBRARY_SUFFIXES variable. From the documentation:

This specifies what suffixes to add to library names when the find_library() command looks for libraries. On Windows systems this is typically .lib and .dll, meaning that when trying to find the foo library it will look for foo.dll etc.

Adding the custom suffix to it should do the trick.