[CMake] cmake "Regular expression "*Windows.*" cannot compile

Phil Pellouchoud Phil at slacker.com
Mon May 5 20:39:07 EDT 2008


Why does this:

SET( PLATFORM_FILTER *Windows.* )

 

FOREACH(INP ${PLATFORM_FILTER})

  MESSAGE( "INP=" ${INP} )

  IF("abc_Windows.cpp" MATCHES "${INP}" )

    MESSAGE( "found a match!" )

  ENDIF("abc_Windows.cpp" MATCHES "${INP}" )

ENDFOREACH(INP ${PLATFORM_FILTER})

 

Produce this:

S:\software\foo\build> cmake ..

-- Check for working C compiler: cl

-- Check for working C compiler: cl -- works

-- Check size of void*

-- Check size of void* - done

-- Check for working CXX compiler: cl

-- Check for working CXX compiler: cl -- works

INP=*Windows.*

RegularExpression::compile(): ?+* follows nothing.

RegularExpression::compile(): Error in compile.

CMake Error: Error in cmake code at

S:/software/data/cmake/allfiles2.cmake:11:

IF had incorrect arguments: "abc_Windows.cpp" MATCHES "${INP}" (Regular
expression "*Windows.*" cannot compile).

Current CMake stack:

[2]     S:/software/data/cmake/allfiles2.cmake

[1]     S:/software/foo/CMakeLists.txt

found a match!

-- Configuring done

 

S:\software\foo\build>

 

I have tried all kinds of variations with regards to using quotes around
different parts, and I can't get it to compile cleanly. 

 

-phil

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20080505/aa2b7a27/attachment.htm>


More information about the CMake mailing list