[CMake] FIND sub-command to the STRING command

Tim Hütz tim at huetz.biz
Fri Feb 4 06:49:48 EST 2011


I don't think that the speed-factor was important in this case. A complete CMake run takes about 25 seconds to run (in my case) and I see no influence in the processing time with my suggested patch or the regular expression sample provided by Michael. I thought that my solution is a bit more intuitive, but I don't know if this is really important for CMake. If you use the provided patch, you can do something like

PROJECT( "STRING FIND command" )
SET( TESTSTRING "This is a test" )
STRING( FIND ${TESTSTRING} "a" APOSITION )
MESSAGE( STATUS "Position of character 'a' is ${APOSITION}" )

Regards,
Tim

Am 04.02.2011 um 12:00 schrieb SF Markus Elfring:

>> mhh, yeah, thats a good idea. Ok, I'll use this for doing a "STRING( FIND ...)" :) It was just an idea to share this patch with you, but you're right. Its easier doing this with regular expressions.
> 
> Can it be that your implementation was faster than a complete regex application for your use case?
> 
> Are there any remarkable differences in the corresponding execution speed and performance characteristics?
> 
> Regards,
> Markus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: PGP.sig
Type: application/pgp-signature
Size: 833 bytes
Desc: Signierter Teil der Nachricht
URL: <http://www.cmake.org/pipermail/cmake/attachments/20110204/6ec3f859/attachment.pgp>


More information about the CMake mailing list