View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0003612CMakeCMakepublic2006-08-15 11:402008-01-23 12:34
ReporterAllen Winter 
Assigned ToKen Martin 
PrioritylowSeverityfeatureReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0003612: Feature for graceful exiting
DescriptionI wish there was a way to exit a cmake script gracefully without raising a FATAL_ERROR.

Something like message(EXIT, "optional message")
that doesn't scare the user with a stack trace or indicate any errors at all.

Or maybe Exit(code)? where you exit with a code?
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0008567)
Alex Neundorf (developer)
2007-08-21 16:27

What's the use case ?
(0009600)
Alex Neundorf (developer)
2007-11-01 06:07

Allen, what's the use case ?

Alex
(0009601)
Josef Karthauser (reporter)
2007-11-01 07:26

It is sometimes necessary for cmake to test things and terminate if the conditions aren't met.

For instance, when adding files to a project, it is possible to write macros so that a file is automatically created from a template file during the cmake process. It may be an error if the template for a given file type isn't found, which would warrant a termination with an error message. I've found that raising a MESSAGE(FATAL_ERROR "some error message") doesn't always terminate, from deep within a macro.
(0010092)
Alex Neundorf (developer)
2008-01-07 17:30

Some ideas:

how about BREAK ?
in a loop: terminate loop

in a macro/function: "return" from that macro/function

on file level: stop processing this file

Alex
(0010237)
Ken Martin (developer)
2008-01-23 12:34

return and break both implemented. return effectively stops processing of the CMakeLists file at that point. So...

message ("unable to find foo")
return()

should help address this issue

 Issue History
Date Modified Username Field Change
2007-08-21 16:27 Alex Neundorf Note Added: 0008567
2007-11-01 06:07 Alex Neundorf Note Added: 0009600
2007-11-01 07:26 Josef Karthauser Note Added: 0009601
2008-01-03 09:13 Bill Hoffman Assigned To Bill Hoffman => Ken Martin
2008-01-07 17:30 Alex Neundorf Note Added: 0010092
2008-01-23 12:34 Ken Martin Status assigned => closed
2008-01-23 12:34 Ken Martin Note Added: 0010237
2008-01-23 12:34 Ken Martin Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team