FindLibIntl.cmake 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Try to find the libintl library. Explicit searching is currently
  2. # only required for Win32, though it might be useful for some UNIX
  3. # variants, too. Therefore code for searching common UNIX include
  4. # directories is included, too.
  5. #
  6. # Once done this will define
  7. #
  8. # LIBINTL_FOUND - system has libintl
  9. # LIBINTL_LIBRARIES - the library needed for linking
  10. IF (LibIntl_LIBRARY)
  11. SET(LibIntl_FIND_QUIETLY TRUE)
  12. ENDIF ()
  13. # for Windows we rely on the environement variables
  14. # %INCLUDE% and %LIB%; FIND_LIBRARY checks %LIB%
  15. # automatically on Windows
  16. IF(WIN32)
  17. FIND_LIBRARY(LibIntl_LIBRARY
  18. NAMES intl
  19. )
  20. ELSE()
  21. FIND_LIBRARY(LibIntl_LIBRARY
  22. NAMES intl
  23. PATHS /usr/lib /usr/local/lib
  24. )
  25. ENDIF()
  26. IF (LibIntl_LIBRARY)
  27. SET(LIBINTL_FOUND TRUE)
  28. SET(LIBINTL_LIBRARIES ${LibIntl_LIBRARY})
  29. ELSE ()
  30. SET(LIBINTL_FOUND FALSE)
  31. ENDIF ()
  32. IF (LIBINTL_FOUND)
  33. IF (NOT LibIntl_FIND_QUIETLY)
  34. MESSAGE(STATUS "Found libintl: ${LibIntl_LIBRARY}")
  35. ENDIF ()
  36. ELSE ()
  37. IF (LibIntl_FIND_REQUIRED)
  38. MESSAGE(FATAL_ERROR "Could NOT find libintl")
  39. ENDIF ()
  40. ENDIF ()
  41. MARK_AS_ADVANCED(LibIntl_LIBRARY)