Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
CMake
CMake
Commits
b6ebd7b7
Commit
b6ebd7b7
authored
Mar 29, 2002
by
Sebastien Barre
Browse files
ENH: Add SEND_ERROR flag to MESSAGE so that an error can be raised within a CMakeList file
parent
61697fab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Source/cmMessageCommand.cxx
View file @
b6ebd7b7
...
...
@@ -25,13 +25,31 @@ bool cmMessageCommand::InitialPass(std::vector<std::string> const& args)
this
->
SetError
(
"called with incorrect number of arguments"
);
return
false
;
}
std
::
string
message
;
std
::
vector
<
std
::
string
>::
const_iterator
i
=
args
.
begin
();
bool
send_error
=
false
;
if
(
*
i
==
"SEND_ERROR"
)
{
send_error
=
true
;
++
i
;
}
for
(;
i
!=
args
.
end
();
++
i
)
{
message
+=
*
i
;
}
cmSystemTools
::
Message
(
message
.
c_str
());
if
(
send_error
)
{
cmSystemTools
::
Error
(
message
.
c_str
());
}
else
{
cmSystemTools
::
Message
(
message
.
c_str
());
}
return
true
;
}
Source/cmMessageCommand.h
View file @
b6ebd7b7
...
...
@@ -60,8 +60,8 @@ public:
virtual
const
char
*
GetFullDocumentation
()
{
return
"MESSAGE(
\"
the
message to display
\"
\"
Title for dialog
\"
)
\n
"
"The
first
argument
is th
e message to display.
The second
argument is
optional and is the title for the dialog box on windows
."
;
"MESSAGE(
[SEND_ERROR]
\"
message to display
\"
...
)
\n
"
"The argument
s ar
e message
s
to display.
If the first
argument is
SEND_ERROR then an error is raised
."
;
}
cmTypeMacro
(
cmMessageCommand
,
cmCommand
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment