FindXSLT.cmake revision 0586e948b7fc1e97fa7cdddf926e4ec768a40392
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# - Try to find XSLT
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# Once done this will define
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# XSLT_FOUND - system has XSLT
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# XSLT_INCLUDE_DIRS - the XSLT include directory
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# XSLT_LIBRARIES - Link these to use XSLT
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# XSLT_DEFINITIONS - Compiler switches required for using XSLT
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# Copyright (c) 2008 Joshua L. Blocher <verbalshadow@gmail.com>
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# Redistribution and use is allowed according to the terms of the New
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# BSD license.
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
5ec701c9f8ccc403ee6fd3e41239df7dcd9faddeBruno Lavitif (XSLT_LIBRARIES AND XSLT_INCLUDE_DIRS)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan # in cache already
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan set(XSLT_FOUND TRUE)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hoganelse (XSLT_LIBRARIES AND XSLT_INCLUDE_DIRS)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan # use pkg-config to get the directories and then use these values
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan # in the FIND_PATH() and FIND_LIBRARY() calls
2d8eba3efb0ced5c2ab004e5b3e949094747aeb3jenkins if (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan include(UsePkgConfig)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan pkgconfig(libxslt _XSLT_INCLUDEDIR _XSLT_LIBDIR _XSLT_LDFLAGS _XSLT_CFLAGS)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan else (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan find_package(PkgConfig)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan if (PKG_CONFIG_FOUND)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan pkg_check_modules(_XSLT libxslt)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan endif (PKG_CONFIG_FOUND)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan endif (${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} EQUAL 4)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan find_path(XSLT_INCLUDE_DIR
3744900be632496920d4c9aca8f94ba6db4dd882Dirk Hogan ${_XSLT_INCLUDEDIR}
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan PATH_SUFFIXES
61ea54c309169801a1833f99729723071c24c047Dirk Hogan find_library(XSLT_LIBRARY
55e32e1d339c1e3417aa96111d48d51eb29be585Dirk Hogan ${_XSLT_LIBDIR}
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan if (XSLT_LIBRARY)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan set(XSLT_FOUND TRUE)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan endif (XSLT_LIBRARY)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan set(XSLT_INCLUDE_DIRS
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan ${XSLT_INCLUDE_DIR}
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan if (XSLT_FOUND)
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan set(XSLT_LIBRARIES
954d71f34d584a7bcc51a5df9933427542081d62Dirk Hogan ${XSLT_LIBRARIES}