diff options
author | Marc Chevrier <marc.chevrier@gmail.com> | 2018-12-20 11:17:35 (GMT) |
---|---|---|
committer | Marc Chevrier <marc.chevrier@gmail.com> | 2018-12-20 11:17:35 (GMT) |
commit | 0495ce4f98497ba607c5d297f2d5dee70d9a36c6 (patch) | |
tree | f7446c837a9f23403669b53de2876bc6e1f4f7b1 /Modules | |
parent | bc789afac9215ea60069393e3a2af4afb149a84c (diff) | |
parent | 9644c835b38d211ee17b5de0bb0ae62fe188eca0 (diff) | |
download | CMake-0495ce4f98497ba607c5d297f2d5dee70d9a36c6.zip CMake-0495ce4f98497ba607c5d297f2d5dee70d9a36c6.tar.gz CMake-0495ce4f98497ba607c5d297f2d5dee70d9a36c6.tar.bz2 |
Merge branch 'topic-findliblzma' into 'master'
FindLibLZMA: add imported target
Closes #18679 and #18680
See merge request cmake/cmake!2730
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindLibLZMA.cmake | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/Modules/FindLibLZMA.cmake b/Modules/FindLibLZMA.cmake index 6d30e57..b7e5815 100644 --- a/Modules/FindLibLZMA.cmake +++ b/Modules/FindLibLZMA.cmake @@ -9,6 +9,18 @@ Find LibLZMA Find LibLZMA headers and library + +IMPORTED Targets +^^^^^^^^^^^^^^^^ + +This module defines :prop_tgt:`IMPORTED` target ``LibLZMA::LibLZMA``, if +LibLZMA has been found. + +Result variables +^^^^^^^^^^^^^^^^ + +This module will set the following variables in your project: + :: LIBLZMA_FOUND - True if liblzma is found. @@ -51,17 +63,23 @@ if (LIBLZMA_LIBRARY) endif () include(${CMAKE_CURRENT_LIST_DIR}/FindPackageHandleStandardArgs.cmake) -FIND_PACKAGE_HANDLE_STANDARD_ARGS(LibLZMA REQUIRED_VARS LIBLZMA_INCLUDE_DIR - LIBLZMA_LIBRARY +find_package_handle_standard_args(LibLZMA REQUIRED_VARS LIBLZMA_LIBRARY + LIBLZMA_INCLUDE_DIR LIBLZMA_HAS_AUTO_DECODER LIBLZMA_HAS_EASY_ENCODER LIBLZMA_HAS_LZMA_PRESET VERSION_VAR LIBLZMA_VERSION_STRING ) +mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY ) if (LIBLZMA_FOUND) set(LIBLZMA_LIBRARIES ${LIBLZMA_LIBRARY}) set(LIBLZMA_INCLUDE_DIRS ${LIBLZMA_INCLUDE_DIR}) + if(NOT TARGET LibLZMA::LibLZMA) + add_library(LibLZMA::LibLZMA UNKNOWN IMPORTED) + set_target_properties(LibLZMA::LibLZMA PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES ${LIBLZMA_INCLUDE_DIR} + IMPORTED_LINK_INTERFACE_LANGUAGES C + IMPORTED_LOCATION ${LIBLZMA_LIBRARY}) + endif() endif () - -mark_as_advanced( LIBLZMA_INCLUDE_DIR LIBLZMA_LIBRARY ) |