aboutsummaryrefslogtreecommitdiff
path: root/modules/FindLibXslt.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'modules/FindLibXslt.cmake')
-rw-r--r--modules/FindLibXslt.cmake45
1 files changed, 45 insertions, 0 deletions
diff --git a/modules/FindLibXslt.cmake b/modules/FindLibXslt.cmake
new file mode 100644
index 00000000..ed23fd64
--- /dev/null
+++ b/modules/FindLibXslt.cmake
@@ -0,0 +1,45 @@
+# - Try to find LibXslt
+# Once done this will define
+#
+# LIBXSLT_FOUND - system has LibXslt
+# LIBXSLT_INCLUDE_DIR - the LibXslt include directory
+# LIBXSLT_LIBRARY - Link these to use OpenGL and GLU
+# LIBXSLT_DEFINITIONS - Compiler switches required for using LibXslt
+#
+
+
+# use pkg-config to get the directories and then use these values
+# in the FIND_PATH() and FIND_LIBRARY() calls
+INCLUDE(UsePkgConfig)
+
+PKGCONFIG(libxslt _LibXsltIncDir _LibXsltLinkDir _LibXsltLinkFlags _LibXsltCflags)
+
+SET(LIBXSLT_DEFINITIONS ${_LibXsltCflags})
+
+FIND_PATH(LIBXSLT_INCLUDE_DIR libxslt/xslt.h
+ ${_LibXsltIncDir}
+ /usr/include
+ /usr/local/include
+)
+
+FIND_LIBRARY(LIBXSLT_LIBRARY NAMES xslt
+ PATHS
+ ${_LibXsltLinkDir}
+ /usr/lib
+ /usr/local/lib
+)
+
+IF(LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARY)
+ SET(LIBXSLT_FOUND TRUE)
+ENDIF(LIBXSLT_INCLUDE_DIR AND LIBXSLT_LIBRARY)
+
+IF(LIBXSLT_FOUND)
+ IF(NOT LIBXSLT_QUIETLY)
+ MESSAGE(STATUS "Found LibXslt: ${LIBXSLT_LIBRARY}")
+ ENDIF(NOT LIBXSLT_QUIETLY)
+ELSE(LIBXSLT_FOUND)
+ IF(NOT LIBXSLT_REQUIRED)
+ MESSAGE(SEND_ERROR "Could not find LibXslt")
+ ENDIF(NOT LIBXSLT_REQUIRED)
+ENDIF(LIBXSLT_FOUND)
+