mirror of
https://git.tukaani.org/xz.git
synced 2024-04-04 12:36:23 +02:00
CMake: Use interface library for better FindLibLZMA compatibility.
https://www.mail-archive.com/xz-devel@tukaani.org/msg00446.html Thanks to Markus Rickert.
This commit is contained in:
parent
64d9814761
commit
a79bd30a6f
1 changed files with 9 additions and 2 deletions
|
@ -452,9 +452,16 @@ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config.cmake"
|
||||||
"include(CMakeFindDependencyMacro)
|
"include(CMakeFindDependencyMacro)
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
|
||||||
find_dependency(Threads)
|
find_dependency(Threads)
|
||||||
|
|
||||||
include(\"\${CMAKE_CURRENT_LIST_DIR}/liblzma-targets.cmake\")
|
include(\"\${CMAKE_CURRENT_LIST_DIR}/liblzma-targets.cmake\")
|
||||||
# Be compatible with the spelling used by the FindLibLZMA module:
|
|
||||||
add_library(LibLZMA::LibLZMA ALIAS liblzma::liblzma)
|
# Be compatible with the spelling used by the FindLibLZMA module. This
|
||||||
|
# doesn't use ALIAS because it would make CMake resolve LibLZMA::LibLZMA
|
||||||
|
# to liblzma::liblzma instead of keeping the original spelling. Keeping
|
||||||
|
# the original spelling is important for good FindLibLZMA compatibility.
|
||||||
|
add_library(LibLZMA::LibLZMA INTERFACE IMPORTED)
|
||||||
|
set_target_properties(LibLZMA::LibLZMA PROPERTIES
|
||||||
|
INTERFACE_LINK_LIBRARIES liblzma::liblzma)
|
||||||
")
|
")
|
||||||
|
|
||||||
# Set CMAKE_INSTALL_LIBDIR and friends.
|
# Set CMAKE_INSTALL_LIBDIR and friends.
|
||||||
|
|
Loading…
Reference in a new issue