aboutsummaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt21
1 files changed, 13 insertions, 8 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5fe769b9..47ce5f56 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -436,22 +436,27 @@ set_target_properties(liblzma PROPERTIES
PREFIX ""
)
-# Create liblzmaConfigVersion.cmake.
+# Create liblzma-config-version.cmake. We use this spelling instead of
+# liblzmaConfig.cmake to make find_package work in case insensitive manner
+# even with case sensitive file systems. This gives more consistent behavior
+# between operating systems.
#
# FIXME: SameMajorVersion is correct for stable releases but it is wrong
# for development releases where each release may have incompatible changes.
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
- "${CMAKE_CURRENT_BINARY_DIR}/liblzmaConfigVersion.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config-version.cmake"
VERSION "${liblzma_VERSION}"
COMPATIBILITY SameMajorVersion)
-# Create liblzmaConfig.cmake.
-file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/liblzmaConfig.cmake"
+# Create liblzma-config.cmake.
+file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config.cmake"
"include(CMakeFindDependencyMacro)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_dependency(Threads)
-include(\"\${CMAKE_CURRENT_LIST_DIR}/liblzmaTargets.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)
")
# Set CMAKE_INSTALL_LIBDIR and friends.
@@ -483,12 +488,12 @@ set(liblzma_INSTALL_CMAKEDIR
install(EXPORT liblzmaTargets
NAMESPACE liblzma::
- FILE liblzmaTargets.cmake
+ FILE liblzma-targets.cmake
DESTINATION "${liblzma_INSTALL_CMAKEDIR}"
COMPONENT liblzma_Development)
-install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblzmaConfig.cmake"
- "${CMAKE_CURRENT_BINARY_DIR}/liblzmaConfigVersion.cmake"
+install(FILES "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config.cmake"
+ "${CMAKE_CURRENT_BINARY_DIR}/liblzma-config-version.cmake"
DESTINATION "${liblzma_INSTALL_CMAKEDIR}"
COMPONENT liblzma_Development)