From a1a7f629184cf068785330c81378106abf240542 Mon Sep 17 00:00:00 2001 From: Ben Boeckel Date: Wed, 20 Apr 2022 14:07:05 -0400 Subject: generated-scripts: improve prose messages with CMake lists Instead of printing a CMake list, make it an English-style list. This also allows the line-break algorithm to make these messages much more readable. --- Source/cmExportFileGenerator.cxx | 6 ++++-- Source/cmInstallExportGenerator.cxx | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx index 3661f07..452eb99 100644 --- a/Source/cmExportFileGenerator.cxx +++ b/Source/cmExportFileGenerator.cxx @@ -1006,9 +1006,11 @@ void cmExportFileGenerator::GenerateExpectedTargetsCode( " return()\n" "endif()\n" "if(NOT _cmake_targets_defined STREQUAL \"\")\n" + " string(REPLACE \";\" \", \" _cmake_targets_defined_text \"${_cmake_targets_defined}\")\n" + " string(REPLACE \";\" \", \" _cmake_targets_not_defined_text \"${_cmake_targets_not_defined}\")\n" " message(FATAL_ERROR \"Some (but not all) targets in this export " - "set were already defined.\\nTargets Defined: ${_cmake_targets_defined}\\n" - "Targets not yet defined: ${_cmake_targets_not_defined}\\n\")\n" + "set were already defined.\\nTargets Defined: ${_cmake_targets_defined_text}\\n" + "Targets not yet defined: ${_cmake_targets_not_defined_text}\\n\")\n" "endif()\n" "unset(_cmake_targets_defined)\n" "unset(_cmake_targets_not_defined)\n" diff --git a/Source/cmInstallExportGenerator.cxx b/Source/cmInstallExportGenerator.cxx index 18ce601..eb7537d 100644 --- a/Source/cmInstallExportGenerator.cxx +++ b/Source/cmInstallExportGenerator.cxx @@ -202,8 +202,10 @@ void cmInstallExportGenerator::GenerateScriptActions(std::ostream& os, os << indentNN << "file(GLOB _cmake_old_config_files \"" << installedDir << this->EFGen->GetConfigImportFileGlob() << "\")\n"; os << indentNN << "if(_cmake_old_config_files)\n"; + os << indentNNN << "string(REPLACE \";\" \", \" _cmake_old_config_files_text \"${_cmake_old_config_files}\")\n"; os << indentNNN << R"(message(STATUS "Old export file \")" << installedFile - << "\\\" will be replaced. Removing files [${_cmake_old_config_files}].\")\n"; + << "\\\" will be replaced. Removing files [${_cmake_old_config_files_text}].\")\n"; + os << indentNNN << "unset(_cmake_old_config_files_text)\n"; os << indentNNN << "file(REMOVE ${_cmake_old_config_files})\n"; os << indentNN << "endif()\n"; os << indentNN << "unset(_cmake_old_config_files)\n"; -- cgit v0.12