[Cmake] please provide example of use of STRING(REGEX REPLACE ... )

Ian Main imain at stemwinder.org
Mon Mar 31 20:23:41 EST 2003


STRING(REGEX REPLACE "[1-9]$" "pod" podpage ${manpage})

or

STRING(REGEX REPLACE <pattern> <replacement string> <target variable> <source string>)

so I think you'd want..

STRING(REGEX REPLACE "\\" "_" PROJECT_NAME ${BUILD_PATH})

or something.. it's a very quirky language ;-)


    Ian


On Mon, Mar 31, 2003 at 06:35:04PM -0500, Bitter, Ingmar (NIH/CC/DRD) wrote:
> Hi,
> 
> Can someone please give an example of the use of STRING(REGEX REPLACE ... )
> 
> I am trying to name my workspace according to the full path, as MSVC++ is
> usually not telling me that anywhere.
> 
> Here is what I would like to do:
> 
> FIND_PATH(BUILD_PATH CMakeLists.txt . ) 
> STRING("\\" REPLACE "_" BUILD_PATH PROJECT_NAME)
> PROJECT(${PROJECT_NAME})
> 
> But my use of the STRING command is wrong.
> How do I use it correctly?
> 
> -Ingmar
> _______________________________________________
> Cmake mailing list
> Cmake at public.kitware.com
> http://public.kitware.com/mailman/listinfo/cmake



More information about the CMake mailing list