FindLibXslt.cmake 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. # - Try to find the LibXslt library
  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. # Additionally, the following two variables are set (but not required for using xslt):
  9. # LIBXSLT_EXSLT_LIBRARIES - Link to these if you need to link against the exslt library
  10. # LIBXSLT_XSLTPROC_EXECUTABLE - Contains the full path to the xsltproc executable if found
  11. #=============================================================================
  12. # Copyright 2006-2009 Kitware, Inc.
  13. # Copyright 2006 Alexander Neundorf <[email protected]>
  14. #
  15. # Distributed under the OSI-approved BSD License (the "License");
  16. # see accompanying file Copyright.txt for details.
  17. #
  18. # This software is distributed WITHOUT ANY WARRANTY; without even the
  19. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  20. # See the License for more information.
  21. #=============================================================================
  22. # (To distribute this file outside of CMake, substitute the full
  23. # License text for the above reference.)
  24. # use pkg-config to get the directories and then use these values
  25. # in the FIND_PATH() and FIND_LIBRARY() calls
  26. FIND_PACKAGE(PkgConfig)
  27. PKG_CHECK_MODULES(PC_LIBXSLT QUIET libxslt)
  28. SET(LIBXSLT_DEFINITIONS ${PC_LIBXSLT_CFLAGS_OTHER})
  29. FIND_PATH(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h
  30. HINTS
  31. ${PC_LIBXSLT_INCLUDEDIR}
  32. ${PC_LIBXSLT_INCLUDE_DIRS}
  33. )
  34. FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
  35. HINTS
  36. ${PC_LIBXSLT_LIBDIR}
  37. ${PC_LIBXSLT_LIBRARY_DIRS}
  38. )
  39. FIND_LIBRARY(LIBXSLT_EXSLT_LIBRARY NAMES exslt libexslt
  40. HINTS
  41. ${PC_LIBXSLT_LIBDIR}
  42. ${PC_LIBXSLT_LIBRARY_DIRS}
  43. )
  44. SET(LIBXSLT_EXSLT_LIBRARIES ${LIBXSLT_EXSLT_LIBRARY} )
  45. FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
  46. # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
  47. # all listed variables are TRUE
  48. INCLUDE(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake)
  49. FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR)
  50. MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR
  51. LIBXSLT_LIBRARIES
  52. LIBXSLT_EXSLT_LIBRARY
  53. LIBXSLT_XSLTPROC_EXECUTABLE)