find_library.rst 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. find_library
  2. ------------
  3. .. |FIND_XXX| replace:: find_library
  4. .. |NAMES| replace:: NAMES name1 [name2 ...] [NAMES_PER_DIR]
  5. .. |SEARCH_XXX| replace:: library
  6. .. |SEARCH_XXX_DESC| replace:: library
  7. .. |XXX_SUBDIR| replace:: lib
  8. .. |CMAKE_PREFIX_PATH_XXX| replace::
  9. <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
  10. |CMAKE_PREFIX_PATH_XXX_SUBDIR|
  11. .. |CMAKE_XXX_PATH| replace:: CMAKE_LIBRARY_PATH
  12. .. |CMAKE_XXX_MAC_PATH| replace:: CMAKE_FRAMEWORK_PATH
  13. .. |SYSTEM_ENVIRONMENT_PATH_XXX| replace:: Directories in LIB,
  14. <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
  15. |SYSTEM_ENVIRONMENT_PREFIX_PATH_XXX_SUBDIR|,
  16. and the directories in PATH itself.
  17. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
  18. <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
  19. |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR|
  20. .. |CMAKE_SYSTEM_XXX_PATH| replace:: CMAKE_SYSTEM_LIBRARY_PATH
  21. .. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_FRAMEWORK_PATH
  22. .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
  23. :variable:`CMAKE_FIND_ROOT_PATH_MODE_LIBRARY`
  24. .. include:: FIND_XXX.txt
  25. When more than one value is given to the NAMES option this command by
  26. default will consider one name at a time and search every directory
  27. for it. The NAMES_PER_DIR option tells this command to consider one
  28. directory at a time and search for all names in it.
  29. If the library found is a framework, then VAR will be set to the full
  30. path to the framework <fullPath>/A.framework. When a full path to a
  31. framework is used as a library, CMake will use a -framework A, and a
  32. -F<fullPath> to link the framework to the target.
  33. If the global property FIND_LIBRARY_USE_LIB64_PATHS is set all search
  34. paths will be tested as normal, with "64/" appended, and with all
  35. matches of "lib/" replaced with "lib64/". This property is
  36. automatically set for the platforms that are known to need it if at
  37. least one of the languages supported by the PROJECT command is
  38. enabled.