FindLibXslt.cmake 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  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. INCLUDE(FindPackageHandleStandardArgs)
  31. # handle the QUIETLY and REQUIRED arguments and set LIBXML2_FOUND to TRUE if
  32. # all listed variables are TRUE
  33. FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibXslt DEFAULT_MSG LIBXSLT_LIBRARIES LIBXSLT_INCLUDE_DIR)
  34. MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES)