summaryrefslogtreecommitdiffstats
path: root/Modules/FindLibXslt.cmake
diff options
context:
space:
mode:
authorMarkus Rickert <rickert@fortiss.org>2020-04-22 19:27:25 (GMT)
committerMarkus Rickert <rickert@fortiss.org>2020-04-28 17:14:03 (GMT)
commit1aa7df411474cd183af7049f3a53c8ac6be75a61 (patch)
treef49f9ccf76b852b76da8578105302479195a20ec /Modules/FindLibXslt.cmake
parentdd506714f40c16d922ad5f78f3fcf0bdd78a5d02 (diff)
downloadCMake-1aa7df411474cd183af7049f3a53c8ac6be75a61.zip
CMake-1aa7df411474cd183af7049f3a53c8ac6be75a61.tar.gz
CMake-1aa7df411474cd183af7049f3a53c8ac6be75a61.tar.bz2
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 4f366a5..9bc855f 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()