/indra/cmake/FindLLQtWebkit.cmake

https://bitbucket.org/lindenlab/viewer-beta/ · CMake · 62 lines · 35 code · 8 blank · 19 comment · 5 complexity · b70488932b2da50e78bc84d09c61c115 MD5 · raw file

  1. # -*- cmake -*-
  2. # - Find llqtwebkit
  3. # Find the llqtwebkit includes and library
  4. # This module defines
  5. # LLQTWEBKIT_INCLUDE_DIR, where to find llqtwebkit.h, etc.
  6. # LLQTWEBKIT_LIBRARY, the llqtwebkit library with full path.
  7. # LLQTWEBKIT_FOUND, If false, do not try to use llqtwebkit.
  8. # also defined, but not for general use are
  9. # LLQTWEBKIT_LIBRARIES, the libraries needed to use llqtwebkit.
  10. # LLQTWEBKIT_LIBRARY_DIRS, where to find the llqtwebkit library.
  11. # LLQTWEBKIT_DEFINITIONS - You should add_definitions(${LLQTWEBKIT_DEFINITIONS})
  12. # before compiling code that includes llqtwebkit library files.
  13. # Try to use pkg-config first.
  14. # This allows to have two different libllqtwebkit packages installed:
  15. # one for viewer 2.x and one for viewer 1.x.
  16. include(FindPkgConfig)
  17. if (PKG_CONFIG_FOUND)
  18. if (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
  19. set(_PACKAGE_ARGS libllqtwebkit>=${LLQtWebkit_FIND_VERSION} REQUIRED)
  20. else (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
  21. set(_PACKAGE_ARGS libllqtwebkit)
  22. endif (LLQtWebkit_FIND_REQUIRED AND LLQtWebkit_FIND_VERSION)
  23. if (NOT "${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS "2.8.2")
  24. # As virtually nobody will have a pkg-config file for this, do this check always quiet.
  25. # Unfortunately cmake 2.8.2 or higher is required for pkg_check_modules to have a 'QUIET'.
  26. set(_PACKAGE_ARGS ${_PACKAGE_ARGS} QUIET)
  27. endif ()
  28. pkg_check_modules(LLQTWEBKIT ${_PACKAGE_ARGS})
  29. endif (PKG_CONFIG_FOUND)
  30. set(LLQTWEBKIT_DEFINITIONS ${LLQTWEBKIT_CFLAGS_OTHER})
  31. find_path(LLQTWEBKIT_INCLUDE_DIR llqtwebkit.h NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_INCLUDE_DIRS})
  32. find_library(LLQTWEBKIT_LIBRARY NAMES llqtwebkit NO_SYSTEM_ENVIRONMENT_PATH HINTS ${LLQTWEBKIT_LIBRARY_DIRS})
  33. if (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND) # If pkg-config couldn't find it, pretend we don't have pkg-config.
  34. set(LLQTWEBKIT_LIBRARIES llqtwebkit)
  35. get_filename_component(LLQTWEBKIT_LIBRARY_DIRS ${LLQTWEBKIT_LIBRARY} PATH)
  36. endif (NOT PKG_CONFIG_FOUND OR NOT LLQTWEBKIT_FOUND)
  37. # Handle the QUIETLY and REQUIRED arguments and set LLQTWEBKIT_FOUND
  38. # to TRUE if all listed variables are TRUE.
  39. include(FindPackageHandleStandardArgs)
  40. find_package_handle_standard_args(
  41. LLQTWEBKIT
  42. DEFAULT_MSG
  43. LLQTWEBKIT_LIBRARY
  44. LLQTWEBKIT_INCLUDE_DIR
  45. LLQTWEBKIT_LIBRARIES
  46. LLQTWEBKIT_LIBRARY_DIRS
  47. )
  48. mark_as_advanced(
  49. LLQTWEBKIT_LIBRARY
  50. LLQTWEBKIT_INCLUDE_DIR
  51. LLQTWEBKIT_LIBRARIES
  52. LLQTWEBKIT_LIBRARY_DIRS
  53. LLQTWEBKIT_DEFINITIONS
  54. )