summaryrefslogtreecommitdiffstats
path: root/Modules/FindLibXslt.cmake
diff options
context:
space:
mode:
authorMarkus Rickert <rickert@fortiss.org>2020-04-23 13:19:30 (GMT)
committerMarkus Rickert <rickert@fortiss.org>2020-04-28 17:14:03 (GMT)
commit8a90ef5a4400ccb5bfe1f867e25dde2254996df7 (patch)
tree7927431df435d6078e005412962072770432d687 /Modules/FindLibXslt.cmake
parent1aa7df411474cd183af7049f3a53c8ac6be75a61 (diff)
downloadCMake-8a90ef5a4400ccb5bfe1f867e25dde2254996df7.zip
CMake-8a90ef5a4400ccb5bfe1f867e25dde2254996df7.tar.gz
CMake-8a90ef5a4400ccb5bfe1f867e25dde2254996df7.tar.bz2
FindLibXslt: use LIBXSLT_LIBRARY as cache variable
Use LIBXSLT_LIBRARY as cache variable instead of LIBXSLT_LIBRARIES to adhere to documented conventions. Check for defined LIBXSLT_LIBRARIES value to support backwards compatibility.
Diffstat (limited to 'Modules/FindLibXslt.cmake')
-rw-r--r--Modules/FindLibXslt.cmake11
1 files changed, 9 insertions, 2 deletions
diff --git a/Modules/FindLibXslt.cmake b/Modules/FindLibXslt.cmake
index 9bc855f..fc7adeb 100644
--- a/Modules/FindLibXslt.cmake
+++ b/Modules/FindLibXslt.cmake
@@ -54,7 +54,14 @@ find_path(LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h
${PC_LIBXSLT_INCLUDE_DIRS}
)
-find_library(LIBXSLT_LIBRARIES NAMES xslt libxslt
+# CMake 3.17 and below used 'LIBXSLT_LIBRARIES' as the name of
+# the cache entry storing the find_library result. Use the
+# value if it was set by the project or user.
+if(DEFINED LIBXSLT_LIBRARIES AND NOT DEFINED LIBXSLT_LIBRARY)
+ set(LIBXSLT_LIBRARY ${LIBXSLT_LIBRARIES})
+endif()
+
+find_library(LIBXSLT_LIBRARY NAMES xslt libxslt
HINTS
${PC_LIBXSLT_LIBDIR}
${PC_LIBXSLT_LIBRARY_DIRS}
@@ -108,7 +115,7 @@ 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}")
+ set_property(TARGET LibXslt::LibXslt APPEND PROPERTY IMPORTED_LOCATION "${LIBXSLT_LIBRARY}")
endif()
if(LIBXSLT_FOUND AND NOT TARGET LibXslt::LibExslt)