CPack Deb: "file" command output needs escaping / filtering
We install a resource file with file extension ".package".
When using CPack to create a debian package, the "file" command invoked in CPackDeb.cmake line 171 outputs something like this:
/path/to/my/file.package: Hewlett-Packard Graphics Language, starting with "PACKAGEFx\332\305V\333n\3338\020}\367W\214\363$\247]z\"
Note the \"
at the end.
This seems to break CMake's list handling. The subsequent call to readelf passes a long list of files as the _FILE argument.
My local fix is to remove any string containing quotes from the "file" command output before appending it to CPACK_DEB_INSTALL_FILES:
string(REGEX MATCH "(^.*:[^\"]*)" INSTALL_FILE_ITEM_ "${INSTALL_FILE_}")
list(APPEND CPACK_DEB_INSTALL_FILES "${CMAKE_MATCH_1}")
I'm not sure if this would cause other issues.
Edited by Brad King