[cmake-developers] [CMake 0013310]: Regular expression documentation doesn't match command effects.

Mantis Bug Tracker mantis at public.kitware.com
Sun Jun 17 15:20:29 EDT 2012


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=13310 
====================================================================== 
Reported By:                don la dieu
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   13310
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   low
Status:                     new
====================================================================== 
Date Submitted:             2012-06-17 15:20 EDT
Last Modified:              2012-06-17 15:20 EDT
====================================================================== 
Summary:                    Regular expression documentation doesn't match
command effects.
Description: 
The documentation for string(REGEX ...) says:

   ()        Saves a matched subexpression, which can be referenced 
             in the REGEX REPLACE operation. Additionally it is saved
             by all regular expression-related commands, including 
             e.g. if( MATCHES ), in the variables CMAKE_MATCH_(0..9).

This doesn't match the behavior of file(STRINGS ... REGEX ...)!


Steps to Reproduce: 

$ echo foo > /tmp/foo
$ cat CMakeLists.txt
file(STRINGS "/tmp/foo" tmpvar REGEX "^(foo)")
message(STATUS "*** ${CMAKE_MATCH_1} = foo")
$ cmake .

results in:
-- ***  = foo

not
-- *** foo = foo
as expected.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2012-06-17 15:20 don la dieu    New Issue                                    
======================================================================




More information about the cmake-developers mailing list