mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-21 15:28:41 -05:00
Merge topic 'set-CACHE-diagnostics'
20c23518d9 set: Improve diagnostics for CACHE mode
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !8679
This commit is contained in:
+12
-4
@@ -115,10 +115,18 @@ bool cmSetCommand(std::vector<std::string> const& args,
|
||||
// we should be nice and try to catch some simple screwups if the last or
|
||||
// next to last args are CACHE then they screwed up. If they used FORCE
|
||||
// without CACHE they screwed up
|
||||
if ((args.back() == "CACHE") ||
|
||||
(args.size() > 1 && args[args.size() - 2] == "CACHE") ||
|
||||
(force && !cache)) {
|
||||
status.SetError("given invalid arguments for CACHE mode.");
|
||||
if (args.back() == "CACHE") {
|
||||
status.SetError(
|
||||
"given invalid arguments for CACHE mode: missing type and docstring");
|
||||
return false;
|
||||
}
|
||||
if (args.size() > 1 && args[args.size() - 2] == "CACHE") {
|
||||
status.SetError(
|
||||
"given invalid arguments for CACHE mode: missing type or docstring");
|
||||
return false;
|
||||
}
|
||||
if (force && !cache) {
|
||||
status.SetError("given invalid arguments: FORCE specified without CACHE");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
1
|
||||
@@ -0,0 +1,19 @@
|
||||
^CMake Error at CacheErrors\.cmake:1 \(set\):
|
||||
set given invalid arguments for CACHE mode: missing type and docstring
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:[0-9]+ \(include\)
|
||||
+
|
||||
CMake Error at CacheErrors\.cmake:2 \(set\):
|
||||
set given invalid arguments for CACHE mode: missing type or docstring
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:[0-9]+ \(include\)
|
||||
+
|
||||
CMake Error at CacheErrors\.cmake:3 \(set\):
|
||||
set given invalid arguments for CACHE mode: missing type or docstring
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:[0-9]+ \(include\)
|
||||
+
|
||||
CMake Error at CacheErrors\.cmake:4 \(set\):
|
||||
set given invalid arguments: FORCE specified without CACHE
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists\.txt:[0-9]+ \(include\)$
|
||||
@@ -0,0 +1,4 @@
|
||||
set (var val CACHE)
|
||||
set (var val CACHE STRING)
|
||||
set (var val CACHE "")
|
||||
set (var val CACH3 STRING "" FORCE)
|
||||
@@ -1,5 +1,6 @@
|
||||
include(RunCMake)
|
||||
|
||||
run_cmake(CacheErrors)
|
||||
run_cmake(ParentScope)
|
||||
run_cmake(ParentPulling)
|
||||
run_cmake(ParentPullingRecursive)
|
||||
|
||||
Reference in New Issue
Block a user