Browse Source

cmake --list-presets: List package as a valid option

Kyle Edwards 3 years ago
parent
commit
e7087308ce

+ 1 - 1
Source/cmake.cxx

@@ -1145,7 +1145,7 @@ void cmake::SetArgs(const std::vector<std::string>& args)
       } else {
         cmSystemTools::Error(
           "Invalid value specified for --list-presets.\n"
-          "Valid values are configure, build, test, or all. "
+          "Valid values are configure, build, test, package, or all. "
           "When no value is passed the default is configure.");
         return false;
       }

+ 1 - 0
Tests/RunCMake/CMakePresets/ListPresetsInvalidType-result.txt

@@ -0,0 +1 @@
+1

+ 3 - 0
Tests/RunCMake/CMakePresets/ListPresetsInvalidType-stderr.txt

@@ -0,0 +1,3 @@
+^CMake Error: Invalid value specified for --list-presets\.
+Valid values are configure, build, test, package, or all\. When no value is passed the default is configure\.
+CMake Error: Run 'cmake --help' for all supported options\.$

+ 1 - 0
Tests/RunCMake/CMakePresets/RunCMakeTest.cmake

@@ -289,6 +289,7 @@ run_cmake_presets(UserInheritance)
 # Test listing presets
 set(CMakePresets_FILE "${RunCMake_SOURCE_DIR}/ListPresets.json.in")
 run_cmake_presets(ListPresets --list-presets)
+run_cmake_presets(ListPresetsInvalidType --list-presets=invalid-type)
 
 set(RunCMake_TEST_BINARY_DIR "${RunCMake_BINARY_DIR}/ListPresetsWorkingDir")
 set(RunCMake_TEST_NO_CLEAN 1)