summaryrefslogtreecommitdiff
path: root/Modules/FindLibXslt.cmake
diff options
context:
space:
mode:
authorMarkus Rickert <rickert@fortiss.org>2020-04-22 21:27:25 +0200
committerMarkus Rickert <rickert@fortiss.org>2020-04-28 19:14:03 +0200
commit1aa7df411474cd183af7049f3a53c8ac6be75a61 (patch)
treef49f9ccf76b852b76da8578105302479195a20ec /Modules/FindLibXslt.cmake
parentdd506714f40c16d922ad5f78f3fcf0bdd78a5d02 (diff)
downloadcmake-1aa7df411474cd183af7049f3a53c8ac6be75a61.tar.gz
FindLibXslt: provide imported targets
Diffstat (limited to 'Modules/FindLibXslt.cmake')
-rw-r--r--Modules/FindLibXslt.cmake36
1 files changed, 34 insertions, 2 deletions
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index 4f366a57cb..9bc855feb1 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -8,9 +8,22 @@ FindLibXslt
Find the XSL Transformations, Extensible Stylesheet Language
Transformations (XSLT) library (LibXslt)
-Once done this will define
+IMPORTED Targets
+^^^^^^^^^^^^^^^^
-::
+The following :prop_tgt:`IMPORTED` targets may be defined:
+
+``LibXslt::LibXslt``
+ If the libxslt library has been found
+``LibXslt::LibExslt``
+ If the libexslt library has been found
+``LibXslt::xsltproc``
+ If the xsltproc command-line executable has been found
+
+Result variables
+^^^^^^^^^^^^^^^^
+
+This module will set the following variables in your project:
LIBXSLT_FOUND - system has LibXslt
LIBXSLT_INCLUDE_DIR - the LibXslt include directory
@@ -90,3 +103,22 @@ mark_as_advanced(LIBXSLT_INCLUDE_DIR
LIBXSLT_LIBRARIES
LIBXSLT_EXSLT_LIBRARY
LIBXSLT_XSLTPROC_EXECUTABLE)
+
+if(LIBXSLT_FOUND AND NOT TARGET LibXslt::LibXslt)
+ add_library(LibXslt::LibXslt UNKNOWN IMPORTED)
+ set_target_properties(LibXslt::LibXslt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXSLT_INCLUDE_DIR}")
+ set_target_properties(LibXslt::LibXslt PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXSLT_DEFINITIONS}")
+ set_property(TARGET LibXslt::LibXslt APPEND PROPERTY IMPORTED_LOCATION "${LIBXSLT_LIBRARIES}")
+endif()
+
+if(LIBXSLT_FOUND AND NOT TARGET LibXslt::LibExslt)
+ add_library(LibXslt::LibExslt UNKNOWN IMPORTED)
+ set_target_properties(LibXslt::LibExslt PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${LIBXSLT_EXSLT_INCLUDE_DIR}")
+ set_target_properties(LibXslt::LibExslt PROPERTIES INTERFACE_COMPILE_OPTIONS "${LIBXSLT_EXSLT_DEFINITIONS}")
+ set_property(TARGET LibXslt::LibExslt APPEND PROPERTY IMPORTED_LOCATION "${LIBXSLT_EXSLT_LIBRARY}")
+endif()
+
+if(LIBXSLT_XSLTPROC_EXECUTABLE AND NOT TARGET LibXslt::xsltproc)
+ add_executable(LibXslt::xsltproc IMPORTED)
+ set_target_properties(LibXslt::xsltproc PROPERTIES IMPORTED_LOCATION "${LIBXSLT_XSLTPROC_EXECUTABLE}")
+endif()