cmake -E tar dereferences hard links
cmake -E tar behaviour towards hard links different to that of GNU tar
bash-5.2# ls -l /test
total 0
-rw-r--r-- 2 root root 0 Aug 4 12:19 file1
-rw-r--r-- 2 root root 0 Aug 4 12:19 file2
bash-5.2# tar czf /test_real_tar.tar.gz /test
tar: Removing leading `/' from member names
tar: Removing leading `/' from hard link targets
bash-5.2# cmake -E tar czf /test_cmake_tar.tar.gz /test
bash-5.2# tar tvf /test_real_tar.tar.gz
drwxr-xr-x root/root 0 2023-08-04 12:19 test/
-rw-r--r-- root/root 0 2023-08-04 12:19 test/file1
hrw-r--r-- root/root 0 2023-08-04 12:19 test/file2 link to test/file1
bash-5.2# tar tvf /test_cmake_tar.tar.gz
drwxr-xr-x root/root 0 2023-08-04 12:19 test/
-rw-r--r-- root/root 0 2023-08-04 12:19 test/file1
-rw-r--r-- root/root 0 2023-08-04 12:19 test/file2
bash-5.2#
GNU tar has a --hard-dereference option to behave as CMake does. I don't expect cmake -E tar to have the same, but I would expect it to store hard links because:
- It's what GNU tar does
- It does make sense for it to store what there is, without modifying it in any way