MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0011795 | CMake | CMake | public | 2011-02-04 11:26 | 2011-06-17 18:25 |
Reporter | Tim Hütz | ||||
Assigned To | Brad King | ||||
Priority | normal | Severity | minor | Reproducibility | N/A |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | |||||
Target Version | CMake 2.8.5 | Fixed in Version | CMake 2.8.5 | ||
Summary | 0011795: Extending the STRING command with a FIND sub-command | ||||
Description | Recently I was searching for a CMake option to get the position of a single character (first appearance) out of a string. As I found nothing which could provide me an easy solution, I pulled the latest development version and added a FIND sub-command to the STRING command. The attached patch supports a forward search (finds the first occurrence of the substring) and a reverse search (which finds the last occurrence of a substring). Here is a sample how the sub-commands works: ----- project( "STRING FIND command" ) cmake_minimum_required(VERSION 2.8) set( TESTSTRING "This is a test and here is another test." ) string( FIND ${TESTSTRING} "a" APOSITION ) string( FIND REVERSE ${TESTSTRING} "a" APOSITIONREV ) message( STATUS "Firt position of character 'a' (8) is ${APOSITION}" ) message( STATUS "Last position of character 'a' (27) is ${APOSITIONREV}" ) ----- I've already discussed this sub-command on the CMake mailing list (http://www.cmake.org/pipermail/cmake/2011-February/042521.html [^]). Maybe, this would be a nice feature for one of the next CMake releases. Best regards, Tim | ||||
Steps To Reproduce | |||||
Additional Information | |||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | 0002-Added-tests-for-the-FIND-sub-command-of-STRING.patch (4,051) 2011-02-15 05:27 https://public.kitware.com/Bug/file/3695/0002-Added-tests-for-the-FIND-sub-command-of-STRING.patch 0001-Added-a-new-STRING-sub-command-called-FIND.patch (4,694) 2011-02-15 09:15 https://public.kitware.com/Bug/file/3697/0001-Added-a-new-STRING-sub-command-called-FIND.patch 0003-Updated-the-tests-for-the-new-signature-of-STRING-FI.patch (4,281) 2011-02-15 11:52 https://public.kitware.com/Bug/file/3701/0003-Updated-the-tests-for-the-new-signature-of-STRING-FI.patch 0004-Changed-the-signature-of-the-FIND-sub-command.patch (2,921) 2011-02-15 11:52 https://public.kitware.com/Bug/file/3702/0004-Changed-the-signature-of-the-FIND-sub-command.patch | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2011-02-04 11:26 | Tim Hütz | New Issue | |||
2011-02-04 11:26 | Tim Hütz | File Added: 0001-Added-a-new-STRING-sub-command-called-FIND.patch | |||
2011-02-04 12:52 | Tim Hütz | Note Added: 0025286 | |||
2011-02-04 12:52 | Tim Hütz | Note Edited: 0025286 | bug_revision_view_page.php?bugnote_id=25286#r188 | ||
2011-02-14 16:46 | Brad King | Note Added: 0025426 | |||
2011-02-15 05:27 | Tim Hütz | File Added: 0002-Added-tests-for-the-FIND-sub-command-of-STRING.patch | |||
2011-02-15 05:30 | Tim Hütz | Note Added: 0025428 | |||
2011-02-15 07:43 | Brad King | File Deleted: 0001-Added-a-new-STRING-sub-command-called-FIND.patch | |||
2011-02-15 07:44 | Brad King | Note Added: 0025430 | |||
2011-02-15 09:15 | Tim Hütz | File Added: 0001-Added-a-new-STRING-sub-command-called-FIND.patch | |||
2011-02-15 09:16 | Tim Hütz | Note Added: 0025433 | |||
2011-02-15 09:29 | Brad King | Assigned To | => Brad King | ||
2011-02-15 09:29 | Brad King | Status | new => assigned | ||
2011-02-15 09:35 | Brad King | Note Added: 0025435 | |||
2011-02-15 11:52 | Tim Hütz | File Added: 0003-Updated-the-tests-for-the-new-signature-of-STRING-FI.patch | |||
2011-02-15 11:52 | Tim Hütz | File Added: 0004-Changed-the-signature-of-the-FIND-sub-command.patch | |||
2011-02-15 11:53 | Tim Hütz | Note Added: 0025439 | |||
2011-02-15 11:55 | Tim Hütz | Note Edited: 0025439 | bug_revision_view_page.php?bugnote_id=25439#r201 | ||
2011-02-15 13:51 | Brad King | Note Added: 0025444 | |||
2011-02-15 13:51 | Brad King | Status | assigned => closed | ||
2011-02-15 13:51 | Brad King | Resolution | open => fixed | ||
2011-02-16 11:40 | David Cole | Target Version | => CMake 2.8.5 | ||
2011-06-17 18:25 | David Cole | Fixed in Version | => CMake 2.8.5 |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|