Browse Source

find_*: Improve error message quoting consistency

Some error messages (Windows registry related) of the `find_xxx` and
`cmake_host_system_information` commands, reported keywords in quotes,
while most commands did not.
Alex Turbov 10 months ago
parent
commit
b48d5aeae7
26 changed files with 33 additions and 33 deletions
  1. 3 3
      Source/cmCMakeHostSystemInformationCommand.cxx
  2. 5 5
      Source/cmFindBase.cxx
  3. 2 2
      Source/cmFindPackageCommand.cxx
  4. 1 1
      Tests/RunCMake/cmake_host_system_information/Registry_BadView2-stderr.txt
  5. 1 1
      Tests/RunCMake/find_file/REGISTRY_VIEW-no-view-stderr.txt
  6. 1 1
      Tests/RunCMake/find_file/REGISTRY_VIEW-wrong-view-stderr.txt
  7. 1 1
      Tests/RunCMake/find_file/VALIDATOR-no-function-stderr.txt
  8. 1 1
      Tests/RunCMake/find_file/VALIDATOR-specify-macro-stderr.txt
  9. 1 1
      Tests/RunCMake/find_file/VALIDATOR-undefined-function-stderr.txt
  10. 1 1
      Tests/RunCMake/find_library/REGISTRY_VIEW-no-view-stderr.txt
  11. 1 1
      Tests/RunCMake/find_library/REGISTRY_VIEW-wrong-view-stderr.txt
  12. 1 1
      Tests/RunCMake/find_library/VALIDATOR-no-function-stderr.txt
  13. 1 1
      Tests/RunCMake/find_library/VALIDATOR-specify-macro-stderr.txt
  14. 1 1
      Tests/RunCMake/find_library/VALIDATOR-undefined-function-stderr.txt
  15. 1 1
      Tests/RunCMake/find_package/REGISTRY_VIEW-no-view-stderr.txt
  16. 1 1
      Tests/RunCMake/find_package/REGISTRY_VIEW-wrong-view-stderr.txt
  17. 1 1
      Tests/RunCMake/find_path/REGISTRY_VIEW-no-view-stderr.txt
  18. 1 1
      Tests/RunCMake/find_path/REGISTRY_VIEW-wrong-view-stderr.txt
  19. 1 1
      Tests/RunCMake/find_path/VALIDATOR-no-function-stderr.txt
  20. 1 1
      Tests/RunCMake/find_path/VALIDATOR-specify-macro-stderr.txt
  21. 1 1
      Tests/RunCMake/find_path/VALIDATOR-undefined-function-stderr.txt
  22. 1 1
      Tests/RunCMake/find_program/REGISTRY_VIEW-no-view-stderr.txt
  23. 1 1
      Tests/RunCMake/find_program/REGISTRY_VIEW-wrong-view-stderr.txt
  24. 1 1
      Tests/RunCMake/find_program/VALIDATOR-no-function-stderr.txt
  25. 1 1
      Tests/RunCMake/find_program/VALIDATOR-specify-macro-stderr.txt
  26. 1 1
      Tests/RunCMake/find_program/VALIDATOR-undefined-function-stderr.txt

+ 3 - 3
Source/cmCMakeHostSystemInformationCommand.cxx

@@ -604,14 +604,14 @@ bool QueryWindowsRegistry(Range args, cmExecutionStatus& status,
        (arguments.ValueNames || arguments.SubKeys)) ||
       (arguments.ValueName.empty() && arguments.ValueNames &&
        arguments.SubKeys)) {
-    status.SetError("given mutually exclusive sub-options \"VALUE\", "
-                    "\"VALUE_NAMES\" or \"SUBKEYS\".");
+    status.SetError("given mutually exclusive sub-options VALUE, "
+                    "VALUE_NAMES or SUBKEYS.");
     return false;
   }
 
   if (!arguments.View.empty() && !cmWindowsRegistry::ToView(arguments.View)) {
     status.SetError(
-      cmStrCat("given invalid value for \"VIEW\": ", arguments.View, '.'));
+      cmStrCat("given invalid value for VIEW: ", arguments.View, '.'));
     return false;
   }
 

+ 5 - 5
Source/cmFindBase.cxx

@@ -133,7 +133,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
       newStyle = true;
     } else if (args[j] == "REGISTRY_VIEW") {
       if (++j == args.size()) {
-        this->SetError("missing required argument for \"REGISTRY_VIEW\"");
+        this->SetError("missing required argument for REGISTRY_VIEW");
         return false;
       }
       auto view = cmWindowsRegistry::ToView(args[j]);
@@ -141,18 +141,18 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
         this->RegistryView = *view;
       } else {
         this->SetError(
-          cmStrCat("given invalid value for \"REGISTRY_VIEW\": ", args[j]));
+          cmStrCat("given invalid value for REGISTRY_VIEW: ", args[j]));
         return false;
       }
     } else if (args[j] == "VALIDATOR") {
       if (++j == args.size()) {
-        this->SetError("missing required argument for \"VALIDATOR\"");
+        this->SetError("missing required argument for VALIDATOR");
         return false;
       }
       auto command = this->Makefile->GetState()->GetCommand(args[j]);
       if (!command) {
         this->SetError(cmStrCat(
-          "command specified for \"VALIDATOR\" is undefined: ", args[j], '.'));
+          "command specified for VALIDATOR is undefined: ", args[j], '.'));
         return false;
       }
       // ensure a macro is not specified as validator
@@ -164,7 +164,7 @@ bool cmFindBase::ParseArguments(std::vector<std::string> const& argsIn)
                                                        item.c_str()) == 0;
                        }) != macros.end()) {
         this->SetError(cmStrCat(
-          "command specified for \"VALIDATOR\" is not a function: ", args[j],
+          "command specified for VALIDATOR is not a function: ", args[j],
           '.'));
         return false;
       }

+ 2 - 2
Source/cmFindPackageCommand.cxx

@@ -754,7 +754,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
       doing = DoingNone;
     } else if (args[i] == "REGISTRY_VIEW") {
       if (++i == args.size()) {
-        this->SetError("missing required argument for \"REGISTRY_VIEW\"");
+        this->SetError("missing required argument for REGISTRY_VIEW");
         return false;
       }
       auto view = cmWindowsRegistry::ToView(args[i]);
@@ -763,7 +763,7 @@ bool cmFindPackageCommand::InitialPass(std::vector<std::string> const& args)
         this->RegistryViewDefined = true;
       } else {
         this->SetError(
-          cmStrCat("given invalid value for \"REGISTRY_VIEW\": ", args[i]));
+          cmStrCat("given invalid value for REGISTRY_VIEW: ", args[i]));
         return false;
       }
     } else if (this->CheckCommonArgument(args[i])) {

+ 1 - 1
Tests/RunCMake/cmake_host_system_information/Registry_BadView2-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at Registry_BadView2.cmake:[0-9]+ \(cmake_host_system_information\):
-  cmake_host_system_information given invalid value for "VIEW": BAD_VIEW.
+  cmake_host_system_information given invalid value for VIEW: BAD_VIEW.
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_file/REGISTRY_VIEW-no-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-no-view.cmake:[0-9]+ \(find_file\):
-  find_file missing required argument for "REGISTRY_VIEW"
+  find_file missing required argument for REGISTRY_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_file/REGISTRY_VIEW-wrong-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-wrong-view.cmake:[0-9]+ \(find_file\):
-  find_file given invalid value for "REGISTRY_VIEW": WRONG_VIEW
+  find_file given invalid value for REGISTRY_VIEW: WRONG_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_file/VALIDATOR-no-function-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-no-function.cmake:[0-9]+ \(find_file\):
-  find_file missing required argument for "VALIDATOR"
+  find_file missing required argument for VALIDATOR
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_file/VALIDATOR-specify-macro-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-specify-macro.cmake:[0-9]+ \(find_file\):
-  find_file command specified for "VALIDATOR" is not a function: check.
+  find_file command specified for VALIDATOR is not a function: check.
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_file/VALIDATOR-undefined-function-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-undefined-function.cmake:[0-9]+ \(find_file\):
-  find_file command specified for "VALIDATOR" is undefined: undefined.
+  find_file command specified for VALIDATOR is undefined: undefined.
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_library/REGISTRY_VIEW-no-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-no-view.cmake:[0-9]+ \(find_library\):
-  find_library missing required argument for "REGISTRY_VIEW"
+  find_library missing required argument for REGISTRY_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_library/REGISTRY_VIEW-wrong-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-wrong-view.cmake:[0-9]+ \(find_library\):
-  find_library given invalid value for "REGISTRY_VIEW": WRONG_VIEW
+  find_library given invalid value for REGISTRY_VIEW: WRONG_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_library/VALIDATOR-no-function-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-no-function.cmake:[0-9]+ \(find_library\):
-  find_library missing required argument for "VALIDATOR"
+  find_library missing required argument for VALIDATOR
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_library/VALIDATOR-specify-macro-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-specify-macro.cmake:[0-9]+ \(find_library\):
-  find_library command specified for "VALIDATOR" is not a function: check.
+  find_library command specified for VALIDATOR is not a function: check.
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_library/VALIDATOR-undefined-function-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-undefined-function.cmake:[0-9]+ \(find_library\):
-  find_library command specified for "VALIDATOR" is undefined: undefined.
+  find_library command specified for VALIDATOR is undefined: undefined.
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_package/REGISTRY_VIEW-no-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-no-view.cmake:[0-9]+ \(find_package\):
-  find_package missing required argument for "REGISTRY_VIEW"
+  find_package missing required argument for REGISTRY_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_package/REGISTRY_VIEW-wrong-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-wrong-view.cmake:[0-9]+ \(find_package\):
-  find_package given invalid value for "REGISTRY_VIEW": WRONG_VIEW
+  find_package given invalid value for REGISTRY_VIEW: WRONG_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_path/REGISTRY_VIEW-no-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-no-view.cmake:[0-9]+ \(find_path\):
-  find_path missing required argument for "REGISTRY_VIEW"
+  find_path missing required argument for REGISTRY_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_path/REGISTRY_VIEW-wrong-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-wrong-view.cmake:[0-9]+ \(find_path\):
-  find_path given invalid value for "REGISTRY_VIEW": WRONG_VIEW
+  find_path given invalid value for REGISTRY_VIEW: WRONG_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_path/VALIDATOR-no-function-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-no-function.cmake:[0-9]+ \(find_path\):
-  find_path missing required argument for "VALIDATOR"
+  find_path missing required argument for VALIDATOR
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_path/VALIDATOR-specify-macro-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-specify-macro.cmake:[0-9]+ \(find_path\):
-  find_path command specified for "VALIDATOR" is not a function: check.
+  find_path command specified for VALIDATOR is not a function: check.
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_path/VALIDATOR-undefined-function-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-undefined-function.cmake:[0-9]+ \(find_path\):
-  find_path command specified for "VALIDATOR" is undefined: undefined.
+  find_path command specified for VALIDATOR is undefined: undefined.
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_program/REGISTRY_VIEW-no-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-no-view.cmake:[0-9]+ \(find_program\):
-  find_program missing required argument for "REGISTRY_VIEW"
+  find_program missing required argument for REGISTRY_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_program/REGISTRY_VIEW-wrong-view-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at REGISTRY_VIEW-wrong-view.cmake:[0-9]+ \(find_program\):
-  find_program given invalid value for "REGISTRY_VIEW": WRONG_VIEW
+  find_program given invalid value for REGISTRY_VIEW: WRONG_VIEW
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_program/VALIDATOR-no-function-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-no-function.cmake:[0-9]+ \(find_program\):
-  find_program missing required argument for "VALIDATOR"
+  find_program missing required argument for VALIDATOR
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_program/VALIDATOR-specify-macro-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-specify-macro.cmake:[0-9]+ \(find_program\):
-  find_program command specified for "VALIDATOR" is not a function: check.
+  find_program command specified for VALIDATOR is not a function: check.
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)

+ 1 - 1
Tests/RunCMake/find_program/VALIDATOR-undefined-function-stderr.txt

@@ -1,4 +1,4 @@
 CMake Error at VALIDATOR-undefined-function.cmake:[0-9]+ \(find_program\):
-  find_program command specified for "VALIDATOR" is undefined: undefined.
+  find_program command specified for VALIDATOR is undefined: undefined.
 Call Stack \(most recent call first\):
   CMakeLists.txt:[0-9]+ \(include\)