summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2022-09-15 18:50:55 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2022-09-15 18:50:55 (GMT)
commite7087308ce9cc529e233489a4cec4c4cd7ece51a (patch)
tree1a15ab6920986414f56c76462d204b7df15dec31
parent01a25d72c69b0a9a60c1a62939d6a2c543448118 (diff)
downloadCMake-e7087308ce9cc529e233489a4cec4c4cd7ece51a.zip
CMake-e7087308ce9cc529e233489a4cec4c4cd7ece51a.tar.gz
CMake-e7087308ce9cc529e233489a4cec4c4cd7ece51a.tar.bz2
cmake --list-presets: List package as a valid option
-rw-r--r--Source/cmake.cxx2
-rw-r--r--Tests/RunCMake/CMakePresets/ListPresetsInvalidType-result.txt1
-rw-r--r--Tests/RunCMake/CMakePresets/ListPresetsInvalidType-stderr.txt3
-rw-r--r--Tests/RunCMake/CMakePresets/RunCMakeTest.cmake1
4 files changed, 6 insertions, 1 deletions
diff --git a/Source/cmake.cxx b/Source/cmake.cxx
index 281e63f..3b105e3 100644
--- a/Source/cmake.cxx
+++ b/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;
}
diff --git a/Tests/RunCMake/CMakePresets/ListPresetsInvalidType-result.txt b/Tests/RunCMake/CMakePresets/ListPresetsInvalidType-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/CMakePresets/ListPresetsInvalidType-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/CMakePresets/ListPresetsInvalidType-stderr.txt b/Tests/RunCMake/CMakePresets/ListPresetsInvalidType-stderr.txt
new file mode 100644
index 0000000..153abee
--- /dev/null
+++ b/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\.$
diff --git a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake b/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
index c511b34..4f57e2f 100644
--- a/Tests/RunCMake/CMakePresets/RunCMakeTest.cmake
+++ b/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)