cmake/FindLibXlst.cmake
changeset 0 4f2f89ce4247
equal deleted inserted replaced
-1:000000000000 0:4f2f89ce4247
       
     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 
       
    16 IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
       
    17    # in cache already
       
    18    SET(LibXslt_FIND_QUIETLY TRUE)
       
    19 ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
       
    20 
       
    21 IF (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})
       
    27 ENDIF (NOT WIN32)
       
    28 
       
    29 FIND_PATH(LIBXSLT_INCLUDE_DIR libxslt/xslt.h
       
    30     PATHS
       
    31     ${PC_XSLT_INCLUDEDIR}
       
    32     ${PC_XSLT_INCLUDE_DIRS}
       
    33   )
       
    34 
       
    35 FIND_LIBRARY(LIBXSLT_LIBRARIES NAMES xslt libxslt
       
    36     PATHS
       
    37     ${PC_XSLT_LIBDIR}
       
    38     ${PC_XSLT_LIBRARY_DIRS}
       
    39   )
       
    40 
       
    41 FIND_LIBRARY(LIBEXSLT_LIBRARIES NAMES exslt libexslt
       
    42     PATHS
       
    43     ${PC_XSLT_LIBDIR}
       
    44     ${PC_XSLT_LIBRARY_DIRS}
       
    45   )
       
    46 
       
    47 IF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
       
    48    SET(LIBXSLT_FOUND TRUE)
       
    49 ELSE (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
       
    50    SET(LIBXSLT_FOUND FALSE)
       
    51 ENDIF (LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARIES)
       
    52 
       
    53 FIND_PROGRAM(LIBXSLT_XSLTPROC_EXECUTABLE xsltproc)
       
    54 # For compatibility with FindLibXslt.cmake from KDE 4.[01].x
       
    55 SET(XSLTPROC_EXECUTABLE ${LIBXSLT_XSLTPROC_EXECUTABLE})
       
    56 
       
    57 IF (LIBXSLT_FOUND)
       
    58    IF (NOT LibXslt_FIND_QUIETLY)
       
    59       MESSAGE(STATUS "Found LibXslt: ${LIBXSLT_LIBRARIES}")
       
    60    ENDIF (NOT LibXslt_FIND_QUIETLY)
       
    61 ELSE (LIBXSLT_FOUND)
       
    62    IF (LibXslt_FIND_REQUIRED)
       
    63       MESSAGE(FATAL_ERROR "Could NOT find LibXslt")
       
    64    ENDIF (LibXslt_FIND_REQUIRED)
       
    65 ENDIF (LIBXSLT_FOUND)
       
    66 
       
    67 MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR  LIBXSLT_LIBRARIES  LIBEXSLT_LIBRARIES  LIBXSLT_XSLTPROC_EXECUTABLE)
       
    68