cmake: add LZ4::LZ4 target for LZ4

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2018-08-06 17:38:07 +08:00
parent 73fa175499
commit c325327e61

View File

@ -32,3 +32,12 @@ find_package_handle_standard_args(LZ4
VERSION_VAR LZ4_VERSION_STRING)
mark_as_advanced(LZ4_INCLUDE_DIR LZ4_LIBRARY)
if(LZ4_FOUND AND NOT (TARGET LZ4::LZ4))
add_library(LZ4::LZ4 UNKNOWN IMPORTED)
set_target_properties(LZ4::LZ4 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${LZ4_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${LZ4_LIBRARY}"
VERSION "${LZ4_VERSION_STRING}")
endif()