Browse Source
cmMakefile: store the number of last matches in a CMake var
cmMakefile: store the number of last matches in a CMake var
With PushScope and PopScope, keeping track of another bit of data for
each scope isn't easy. Instead, store it as another CMake variable so it
gets implicitly tracked along with everything else.
This works in a revert of commit
7d674b5f0b
.
pull/133/head

8 changed files with 83 additions and 43 deletions
-
1Help/manual/cmake-variables.7.rst
-
5Help/release/dev/cached-regex-clear-fixed.rst
-
8Help/variable/CMAKE_MATCH_COUNT.rst
-
5Source/cmConditionEvaluator.cxx
-
58Source/cmMakefile.cxx
-
3Source/cmMakefile.h
-
44Source/cmStringCommand.cxx
-
2Source/cmStringCommand.h
@ -0,0 +1,5 @@ |
|||
cached-regex-clear-fixed |
|||
------------------------ |
|||
|
|||
* Add :variable:`CMAKE_MATCH_COUNT` for the number of matches made in the last |
|||
regular expression. |
@ -0,0 +1,8 @@ |
|||
CMAKE_MATCH_COUNT |
|||
----------------- |
|||
|
|||
The number of matches with the last regular expression. |
|||
|
|||
When a regular expression match is used, CMake fills in ``CMAKE_MATCH_<n>`` |
|||
variables with the match contents. The ``CMAKE_MATCH_COUNT`` variable holds |
|||
the number of match expressions when these are filled. |
Write
Preview
Loading…
Cancel
Save
Reference in new issue