FindLibXslt.cmake 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # - Try to find LibXslt
  2. # Once done this will define
  3. #
  4. # LIBXSLT_FOUND - system has LibXslt
  5. # LIBXSLT_INCLUDE_DIR - the LibXslt include directory
  6. # LIBXSLT_LIBRARIES - Link these to LibXslt
  7. # LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
  8. # Copyright (c) 2006, Alexander Neundorf, <[email protected]>
  9. #
  10. # Redistribution and use is allowed according to the terms of the BSD license.
  11. # For details see the accompanying COPYING-CMAKE-SCRIPTS file.
  12. IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
  13. # in cache already
  14. SET(LibXslt_FIND_QUIETLY TRUE)
  15. ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
  16. IF (NOT WIN32)
  17. # use pkg-config to get the directories and then use these values
  18. # in the FIND_PATH() and FIND_LIBRARY() calls
  19. INCLUDE(UsePkgConfig)
  20. PKGCONFIG(libxslt _LibXsltIncDir _LibXsltLinkDir _LibXsltLinkFlags _LibXsltCflags)
  21. SET(LIBXSLT_DEFINITIONS ${_LibXsltCflags})
  22. ENDIF (NOT WIN32)
  23. FIND_PATH(LIBXSLT_INCLUDE_DIR libxslt/xslt.h
  24. ${_LibXsltIncDir}
  25. )
  26. FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
  27. PATHS
  28. ${_LibXsltLinkDir}
  29. )
  30. IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
  31. SET(LIBXSLT_FOUND TRUE)
  32. ELSE (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
  33. SET(LIBXSLT_FOUND FALSE)
  34. ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
  35. IF (LIBXSLT_FOUND)
  36. IF (NOT LibXslt_FIND_QUIETLY)
  37. MESSAGE(STATUS "Found LibXslt: ${LIBXSLT_LIBRARIES}")
  38. ENDIF (NOT LibXslt_FIND_QUIETLY)
  39. ELSE (LIBXSLT_FOUND)
  40. IF (LibXslt_FIND_REQUIRED)
  41. MESSAGE(FATAL_ERROR "Could NOT find LibXslt")
  42. ENDIF (LibXslt_FIND_REQUIRED)
  43. ENDIF (LIBXSLT_FOUND)
  44. MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES)