0

I have a third-party library that needs to be hooked up intpo cmake project. The library is built for a number of platforms, so in its folder, there are files:

  • libName_x86.lib
  • libName_x86.dll
  • libname_x64.lib
  • libName_x64.dll
  • libName_android.x86.a
  • libName_android.x86_64.a
  • libName_macosx.a
  • libName_mac.xcconfig
  • libName_mac.Debug.xcconfig
  • libName_mac.Release.xcconfig

and so on.

What would be the proper cmake way to determine name of the library in the find script?

Srv19
  • 3,458
  • 6
  • 44
  • 75
  • 1
    When pass plain "libName" to `find_library`, CMake will automatically append platform-specific prefix and suffix(file extensions) to this name. But CMake definitely does not aware about name suffixies like `_x86`, `_android`. So, for choose between e.g. `libName_x86` and `libName_android` you need to check the OS. See [that question](https://stackoverflow.com/questions/9160335/os-specific-instructions-in-cmake-how-to) for more info about checking the OS. As for `.xcconfig` files, they are not the *libraries* but XCode projects. – Tsyvarev Jul 03 '20 at 12:22
  • You might try something like [this](https://stackoverflow.com/a/17127764/3987854). – Kevin Jul 03 '20 at 12:49

0 Answers0