find_library.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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:: PATH and LIB
  14. .. |CMAKE_SYSTEM_PREFIX_PATH_XXX| replace::
  15. <prefix>/lib/<arch> if CMAKE_LIBRARY_ARCHITECTURE is set, and
  16. |CMAKE_SYSTEM_PREFIX_PATH_XXX_SUBDIR|
  17. .. |CMAKE_SYSTEM_XXX_PATH| replace:: CMAKE_SYSTEM_LIBRARY_PATH
  18. .. |CMAKE_SYSTEM_XXX_MAC_PATH| replace:: CMAKE_SYSTEM_FRAMEWORK_PATH
  19. .. |CMAKE_FIND_ROOT_PATH_MODE_XXX| replace::
  20. CMAKE_FIND_ROOT_PATH_MODE_LIBRARY
  21. .. include:: FIND_XXX.txt
  22. When more than one value is given to the NAMES option this command by
  23. default will consider one name at a time and search every directory
  24. for it. The NAMES_PER_DIR option tells this command to consider one
  25. directory at a time and search for all names in it.
  26. If the library found is a framework, then VAR will be set to the full
  27. path to the framework <fullPath>/A.framework. When a full path to a
  28. framework is used as a library, CMake will use a -framework A, and a
  29. -F<fullPath> to link the framework to the target.
  30. If the global property FIND_LIBRARY_USE_LIB64_PATHS is set all search
  31. paths will be tested as normal, with "64/" appended, and with all
  32. matches of "lib/" replaced with "lib64/". This property is
  33. automatically set for the platforms that are known to need it if at
  34. least one of the languages supported by the PROJECT command is
  35. enabled.