diff options
author | Ben Boeckel <ben.boeckel@kitware.com> | 2022-04-27 18:29:52 (GMT) |
---|---|---|
committer | Ben Boeckel <ben.boeckel@kitware.com> | 2022-04-27 18:30:41 (GMT) |
commit | 0513a1fe1065f0bfbf30c5c406dd47afd9dfbba4 (patch) | |
tree | bb1bf2a22394a282345521e0079c50d3aba74026 /Source/cmInstallGenerator.cxx | |
parent | 44a110eb80d3b0a2c04d7a0eac4f3d6bfba54ebd (diff) | |
download | CMake-0513a1fe1065f0bfbf30c5c406dd47afd9dfbba4.zip CMake-0513a1fe1065f0bfbf30c5c406dd47afd9dfbba4.tar.gz CMake-0513a1fe1065f0bfbf30c5c406dd47afd9dfbba4.tar.bz2 |
cmInstallGenerator: use CMake-private variables in generated code
Diffstat (limited to 'Source/cmInstallGenerator.cxx')
-rw-r--r-- | Source/cmInstallGenerator.cxx | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/Source/cmInstallGenerator.cxx b/Source/cmInstallGenerator.cxx index a33ad78..87110a9 100644 --- a/Source/cmInstallGenerator.cxx +++ b/Source/cmInstallGenerator.cxx @@ -91,21 +91,28 @@ void cmInstallGenerator::AddInstallRule( os << "\")\n"; } if (files_var) { - os << indent << "foreach(_f IN LISTS " << files_var << ")\n"; - os << indent.Next() << "get_filename_component(_fn \"${_f}\" NAME)\n"; + os << indent << "foreach(_cmake_abs_file IN LISTS " << files_var + << ")\n"; + os << indent.Next() + << "get_filename_component(_cmake_abs_file_name " + "\"${_cmake_abs_file}\" NAME)\n"; os << indent.Next() << "list(APPEND CMAKE_ABSOLUTE_DESTINATION_FILES \"" - << dest << "/${_fn}\")\n"; + << dest << "/${_cmake_abs_file_name}\")\n"; os << indent << "endforeach()\n"; + os << indent << "unset(_cmake_abs_file_name)\n"; + os << indent << "unset(_cmake_abs_file)\n"; } os << indent << "if(CMAKE_WARN_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; - os << indent.Next() << "message(WARNING \"ABSOLUTE path INSTALL " - << "DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; + os << indent.Next() + << "message(WARNING \"ABSOLUTE path INSTALL " + "DESTINATION : ${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; os << indent << "endif()\n"; os << indent << "if(CMAKE_ERROR_ON_ABSOLUTE_INSTALL_DESTINATION)\n"; - os << indent.Next() << "message(FATAL_ERROR \"ABSOLUTE path INSTALL " - << "DESTINATION forbidden (by caller): " - << "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; + os << indent.Next() + << "message(FATAL_ERROR \"ABSOLUTE path INSTALL " + "DESTINATION forbidden (by caller): " + "${CMAKE_ABSOLUTE_DESTINATION_FILES}\")\n"; os << indent << "endif()\n"; } std::string absDest = ConvertToAbsoluteDestination(dest); |