View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011714CMakeCMakepublic2011-01-17 10:312011-01-17 11:06
ReporterMarkus Elfring 
Assigned ToBrad King 
PrioritynormalSeverityfeatureReproducibilityalways
StatusclosedResolutionsuspended 
PlatformOSOS Version
Product VersionCMake 2.8.3 
Target VersionFixed in Version 
Summary0011714: Directly reading data from a file into variables
DescriptionI 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 ...)"?
TagsNo tags attached.
Attached Files

 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.

 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


Copyright © 2000 - 2018 MantisBT Team