cmake.exe --install does not write "cmake_mode_t" ADS when cross compiling
When using CMake version from the 64-Bit Windows installer for CMake 3.21.3, the installed cmake somehow no longer writes the "cmake_mode_t" alternate NTFS data stream that CPackDeb needs to set the permissions correctly. Oddly, if I build the identical version of CMake myself, it works ok.
I have attached a test project to demonstrate what I mean.
Running the test.bat
from the zip file with the CMake delivered by the installer, I get the following output:
cmake version 3.21.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.29.30136.0
-- The CXX compiler identification is MSVC 19.29.30136.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: XXXX/CMake-permissions/out
-- Install configuration: "Release"
-- Installing: XXXX/CMake-permissions/install/bin/test.sh
Volume in Laufwerk C: hat keine Bezeichnung.
Volumeseriennummer: XXXX-XXXX
Verzeichnis von XXXX\CMake-permissions\install\bin
15.10.2021 10:40 <DIR> .
15.10.2021 10:40 <DIR> ..
15.10.2021 10:04 11 test.sh
1 Datei(en), 11 Bytes
2 Verzeichnis(se), XXXX Bytes frei
Executing the same batch file with the PATH variable pointing to an executable of CMake 3.21.3 I built myself using Vustial Studio 16.11.4, I get the following output (Sorry about the German):
cmake version 3.21.3
CMake suite maintained and supported by Kitware (kitware.com/cmake).
-- Building for: Visual Studio 16 2019
-- The C compiler identification is MSVC 19.29.30136.0
-- The CXX compiler identification is MSVC 19.29.30136.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.29.30133/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: XXXX/CMake-permissions/out
-- Install configuration: "Release"
-- Installing: XXXX/CMake-permissions/install/bin/test.sh
Volume in Laufwerk C: hat keine Bezeichnung.
Volumeseriennummer: XXXX-XXXX
Verzeichnis von XXXX\CMake-permissions\install\bin
15.10.2021 10:43 <DIR> .
15.10.2021 10:43 <DIR> ..
15.10.2021 10:04 11 test.sh
5 test.sh:cmake_mode_t:$DATA
1 Datei(en), 11 Bytes
2 Verzeichnis(se), XXXX Bytes frei
As you can see, the listings at the end differ, in that the custom built version of CMake correctly added an ADS stream test.sh:cmake_mode_t:$DATA
containing the permissions. The CMake from the installer, however, did not.