MantisBT - CMake
View Issue Details
0013205CMake(No Category)public2012-05-09 16:202012-10-01 13:22
Dave Abrahams 
 
normalminorhave not tried
closedno change required 
 
 
0013205: XXXConfig.cmake files should perhaps all include a function scope
I spent hours tracking down a bug where a variable was set in the INIT section of the file and then later used, after generated find_package calls. And now a colleague just made the same mistake again. IMO it is too error-prone to have most of that code operating at global scope. It might be better to wrap the generated code inside a function so any variable settings become local.
No tags attached.
Issue History
2012-05-09 16:20Dave AbrahamsNew Issue
2012-05-09 16:22Dave AbrahamsNote Added: 0029460
2012-05-09 16:30Brad KingStatusnew => resolved
2012-05-09 16:30Brad KingResolutionopen => no change required
2012-10-01 13:22David ColeNote Added: 0031124
2012-10-01 13:22David ColeStatusresolved => closed

Notes
(0029460)
Dave Abrahams   
2012-05-09 16:22   
Maybe you should close this; obviously the intent of the file is to set a bunch of global variables, so a function scope would disable that.
(0031124)
David Cole   
2012-10-01 13:22   
Closing resolved issues that have not been updated in more than 4 months.