FindLibXslt.cmake 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #=============================================================================
  9. # Copyright 2006-2009 Kitware, Inc.
  10. # Copyright 2006 Alexander Neundorf <[email protected]>
  11. #
  12. # Distributed under the OSI-approved BSD License (the "License");
  13. # see accompanying file Copyright.txt for details.
  14. #
  15. # This software is distributed WITHOUT ANY WARRANTY; without even the
  16. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  17. # See the License for more information.
  18. #=============================================================================
  19. # (To distributed this file outside of CMake, substitute the full
  20. # License text for the above reference.)
  21. IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
  22. # in cache already
  23. SET(LibXslt_FIND_QUIETLY TRUE)
  24. ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
  25. IF (NOT WIN32)
  26. # use pkg-config to get the directories and then use these values
  27. # in the FIND_PATH() and FIND_LIBRARY() calls
  28. INCLUDE(UsePkgConfig)
  29. PKGCONFIG(libxslt _LibXsltIncDir _LibXsltLinkDir _LibXsltLinkFlags _LibXsltCflags)
  30. SET(LIBXSLT_DEFINITIONS ${_LibXsltCflags})
  31. ENDIF (NOT WIN32)
  32. FIND_PATH(LIBXSLT_INCLUDE_DIR libxslt/xslt.h
  33. ${_LibXsltIncDir}
  34. )
  35. FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
  36. PATHS
  37. ${_LibXsltLinkDir}
  38. )
  39. INCLUDE(FindPackageHandleStandardArgs)
  40. # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
  41. # all listed variables are TRUE
  42. FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR)
  43. MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES)