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#  LIBXSLT_XSLTPROC_EXECUTABLE - path to the xsltproc tool
9
10# Copyright (c) 2006, Alexander Neundorf, <neundorf@kde.org>
11#
12# Redistribution and use is allowed according to the terms of the BSD license.
13# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
14
15
16IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
17   # in cache already
18   SET(LibXslt_FIND_QUIETLY TRUE)
19ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
20
21IF (NOT WIN32)
22   # use pkg-config to get the directories and then use these values
23   # in the FIND_PATH() and FIND_LIBRARY() calls
24   find_package(PkgConfig)
25   pkg_check_modules(PC_XSLT QUIET libxslt)
26   SET(LIBXSLT_DEFINITIONS ${PC_XSLT_CFLAGS_OTHER})
27ENDIF (NOT WIN32)
28
29FIND_PATH(LIBXSLT_INCLUDE_DIR libxslt/xslt.h
30    PATHS
31    ${PC_XSLT_INCLUDEDIR}
32    ${PC_XSLT_INCLUDE_DIRS}
33  )
34
35FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
36    PATHS
37    ${PC_XSLT_LIBDIR}
38    ${PC_XSLT_LIBRARY_DIRS}
39  )
40
41FIND_LIBRARY(LIBEXSLT_LIBRARIES NAMES exslt libexslt
42    PATHS
43    ${PC_XSLT_LIBDIR}
44    ${PC_XSLT_LIBRARY_DIRS}
45  )
46
47IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
48   SET(LIBXSLT_FOUND TRUE)
49ELSE (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
50   SET(LIBXSLT_FOUND FALSE)
51ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
52
53FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
54# For compatibility with FindLibXslt.cmake from KDE 4.[01].x
55SET(XSLTPROC_EXECUTABLE ${LIBXSLT_XSLTPROC_EXECUTABLE})
56
57IF (LIBXSLT_FOUND)
58   IF (NOT LibXslt_FIND_QUIETLY)
59      MESSAGE(STATUS "Found LibXslt: ${LIBXSLT_LIBRARIES}")
60   ENDIF (NOT LibXslt_FIND_QUIETLY)
61ELSE (LIBXSLT_FOUND)
62   IF (LibXslt_FIND_REQUIRED)
63      MESSAGE(FATAL_ERROR "Could NOT find LibXslt")
64   ENDIF (LibXslt_FIND_REQUIRED)
65ENDIF (LIBXSLT_FOUND)
66
67MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR  LIBXSLT_LIBRARIES  LIBEXSLT_LIBRARIES  LIBXSLT_XSLTPROC_EXECUTABLE)
68
69