View Issue Details [ Jump to Notes ] | [ Print ] | ||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||
0011714 | CMake | CMake | public | 2011-01-17 10:31 | 2011-01-17 11:06 | ||||
Reporter | Markus Elfring | ||||||||
Assigned To | Brad King | ||||||||
Priority | normal | Severity | feature | Reproducibility | always | ||||
Status | closed | Resolution | suspended | ||||||
Platform | OS | OS Version | |||||||
Product Version | CMake 2.8.3 | ||||||||
Target Version | Fixed in Version | ||||||||
Summary | 0011714: Directly reading data from a file into variables | ||||||||
Description | I would like to read some data from a file into CMake variables. Your programming supports this kind of context-dependent data extraction with two steps so far. Example: 1. file(STRINGS ${file_name} ${variable_for_file_data} REGEX ${pattern1}) 2. string(REGEX REPLACE ${pattern2} "\\1" ${variable_for_data_element} ${variable_for_file_data}) This proccessing approach requires the evaluation of two similar regular expressions. This is not as efficient as I imagine it could be. - I do not really need any replacement features for this use case. It seems that it is only needed at the moment because the subfunction "string(REGEX REPLACE ...)" is the only one with (partly documented) support for subexpressions in regular expressions. - It would be convenient if parts from the input lines could be directly assigned to variables by the file command. Would you like to add the capability for improved data selection to a variant of the function "file(STRINGS ...)"? | ||||||||
Tags | No tags attached. | ||||||||
Attached Files | |||||||||
Relationships | |
Relationships |
Notes | |
(0024756) Brad King (manager) 2011-01-17 11:06 |
The issue tracker is meant for monitoring specific changes to CMake that need developer attention. We have better things to do than answer questions here. Please bring general discussion to the mailing list where it will get more exposure. CMake is not a general purpose programming language. Files read by CMake while configuring the project should be small enough that double-regex processing is not a performance bottleneck. If you need to do high-speed data processing use a scripting language or add a C program to your project that runs at build time to do necessary processing. If you feel this is an insufficient resolution please come back with an actual proposed patch. |
Notes |
Issue History | |||
Date Modified | Username | Field | Change |
2011-01-17 10:31 | Markus Elfring | New Issue | |
2011-01-17 11:06 | Brad King | Note Added: 0024756 | |
2011-01-17 11:06 | Brad King | Status | new => closed |
2011-01-17 11:06 | Brad King | Assigned To | => Brad King |
2011-01-17 11:06 | Brad King | Resolution | open => suspended |
Issue History |
Copyright © 2000 - 2018 MantisBT Team |