I must be Doing It Wrong; but I'm not seeing how...

If I do a REGEX MATCH as follows:

> build_command(FOO)
> string(REGEX MATCH "/build ([A-Za-z]+)" BUILD_CONFIG ${FOO})
> message(STATUS "BUILD_CONFIG = ${BUILD_CONFIG}")


... I get, as expected:

> BUILD_CONFIG = /build Release

However, if I use the same expression with REGEX REPLACE:

> build_command(FOO)
> string(REGEX REPLACE "/build ([A-Za-z]+)" "\\1" BUILD_CONFIG ${FOO})
> message(STATUS "BUILD_CONFIG = ${BUILD_CONFIG}")

... BUILD_CONFIG holds the entire build command line rather than just the 
configuration name:

> BUILD_CONFIG = C:\PROGRA~2\MICROS~1.0\Common7\IDE\devenv.com my.sln Release 
> /project ALL_BUILD


How am I misapplying REGEX REPLACE?

-- 
Braden McDaniel
bra...@endoframe.com

--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to