diff options
Diffstat (limited to 'Modules/FindLibXslt.cmake')
-rw-r--r-- | Modules/FindLibXslt.cmake | 11 |
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) |