mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 23:00:07 -06:00
cmLocalGenerator: Support arbitrary component name when installing
The generated `cmake_install.cmake` script no longer blindly tries to create files `install_manifest_<component-name>.txt` that partly consists of the verbatim name of a component, which might contain characters that are not supported on the platform / filesystem. Instead, if the component's name contains a (possibly) problematic character its MD5 hash will be used: `install_manifest_<component-hash>.txt`
This commit is contained in:
@@ -717,8 +717,15 @@ void cmLocalGenerator::GenerateInstallRules()
|
||||
/* clang-format off */
|
||||
fout <<
|
||||
"if(CMAKE_INSTALL_COMPONENT)\n"
|
||||
" set(CMAKE_INSTALL_MANIFEST \"install_manifest_"
|
||||
" if(CMAKE_INSTALL_COMPONENT MATCHES \"^[a-zA-Z0-9_.+-]+$\")\n"
|
||||
" set(CMAKE_INSTALL_MANIFEST \"install_manifest_"
|
||||
"${CMAKE_INSTALL_COMPONENT}.txt\")\n"
|
||||
" else()\n"
|
||||
" string(MD5 CMAKE_INST_COMP_HASH \"${CMAKE_INSTALL_COMPONENT}\")\n"
|
||||
" set(CMAKE_INSTALL_MANIFEST \"install_manifest_"
|
||||
"${CMAKE_INST_COMP_HASH}.txt\")\n"
|
||||
" unset(CMAKE_INST_COMP_HASH)\n"
|
||||
" endif()\n"
|
||||
"else()\n"
|
||||
" set(CMAKE_INSTALL_MANIFEST \"install_manifest.txt\")\n"
|
||||
"endif()\n"
|
||||
|
||||
Reference in New Issue
Block a user