Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CMake Regex to convert lower case to upper case

Tags:

regex

cmake

Hi i'm trying to convert a string of lowercase letters to uppercase using regex in a cmake file.

The command i'm using is:
string(REGEX REPLACE match replace output input)

Does anyone know how to specify that each lower case letter be replaced with its uppercase counterpart using cmake's regex facility?

like image 299
radman Avatar asked Feb 05 '11 05:02

radman


1 Answers

I don't think it is possible to do that with a CMake regular expression. If you just want to convert a string to uppercase you can use the TOUPPER string function:

string(TOUPPER <string1> <output variable>)

Example to convert the contents of a variable to uppercase:

string(TOUPPER ${VARNAME} VARNAME)
like image 93
sakra Avatar answered Sep 18 '22 15:09

sakra