diff options
author | Yann Collet <Cyan4973@users.noreply.github.com> | 2024-05-09 16:42:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-09 16:42:18 -0700 |
commit | f8df9dd749a549dec20aa286a7639ba04190faab (patch) | |
tree | ce0e6a4f9e2b20bbff0a6973a704aa97e71fee72 | |
parent | c537f782c44a0ced71bcf271356aef9506f1375c (diff) | |
parent | ba744bd16c80dea1812f38cee060f232f1edce5f (diff) | |
download | lz4-upstream-dev.tar.gz |
Merge pull request #1395 from ur4t/fix-cli-symlinksupstream-dev
CMake: Separate symlinks creation and installation
-rw-r--r-- | build/cmake/CMakeLists.txt | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/build/cmake/CMakeLists.txt b/build/cmake/CMakeLists.txt index 358f6ecb..111781f4 100644 --- a/build/cmake/CMakeLists.txt +++ b/build/cmake/CMakeLists.txt @@ -229,14 +229,15 @@ if(NOT LZ4_BUNDLED_MODE) # install lz4cat and unlz4 symlinks on *nix if(UNIX AND LZ4_BUILD_CLI) - install(CODE " - foreach(f lz4cat unlz4) - set(dest \"\$ENV{DESTDIR}${CMAKE_INSTALL_FULL_BINDIR}/\${f}\") - message(STATUS \"Symlinking: \${dest} -> lz4\") - execute_process( - COMMAND \"${CMAKE_COMMAND}\" -E create_symlink lz4 \"\${dest}\") - endforeach() - ") + foreach(f lz4cat unlz4) + add_custom_target("create_${f}" ALL + "${CMAKE_COMMAND}" -E create_symlink + "$<TARGET_FILE_NAME:lz4cli>" "${f}" + BYPRODUCTS "${f}" + VERBATIM) + install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${f}" + DESTINATION "${CMAKE_INSTALL_BINDIR}") + endforeach() # create manpage aliases foreach(f lz4cat unlz4) |