aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYann Collet <cyan@fb.com>2024-05-09 16:52:28 -0700
committerYann Collet <cyan@fb.com>2024-05-09 16:52:28 -0700
commitbdc8e14e5a493615cdbefc5d1e1ed737dae95b2d (patch)
tree2fd699c0d95bd7f1a8cf1b5416bc17520b2dfd2b
parentf8df9dd749a549dec20aa286a7639ba04190faab (diff)
downloadlz4-bdc8e14e5a493615cdbefc5d1e1ed737dae95b2d.tar.gz
[cmake]: just a minor refactor of the symlink installation paragraph
for improved readability.
-rw-r--r--build/cmake/CMakeLists.txt20
1 files changed, 12 insertions, 8 deletions
diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt
index 111781f4..428f531c 100644
--- a/build/cmake/CMakeLists.txt
+++ b/build/cmake/CMakeLists.txt
@@ -227,16 +227,20 @@ if(NOT LZ4_BUNDLED_MODE)
${CMAKE_CURRENT_BINARY_DIR}/lz4ConfigVersion.cmake
DESTINATION ${LZ4_PKG_INSTALLDIR})
- # install lz4cat and unlz4 symlinks on *nix
+ # Install lz4cat and unlz4 symlinks on Unix systems
if(UNIX AND LZ4_BUILD_CLI)
- foreach(f lz4cat unlz4)
- add_custom_target("create_${f}" ALL
- "${CMAKE_COMMAND}" -E create_symlink
- "$<TARGET_FILE_NAME:lz4cli>" "${f}"
- BYPRODUCTS "${f}"
+ foreach(cli_tool IN ITEMS lz4cat unlz4)
+ # Create a custom target for the symlink creation
+ add_custom_target("create_${cli_tool}_symlink" ALL
+ COMMAND ${CMAKE_COMMAND} -E create_symlink
+ $<TARGET_FILE_NAME:lz4cli> ${cli_tool}
+ COMMENT "Creating symlink for ${cli_tool}"
VERBATIM)
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${f}"
- DESTINATION "${CMAKE_INSTALL_BINDIR}")
+
+ # Install the symlink into the binary installation directory
+ install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${cli_tool}"
+ DESTINATION ${CMAKE_INSTALL_BINDIR}
+ RENAME ${cli_tool})
endforeach()
# create manpage aliases