<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>I found the solution:</p>
<pre> get_cmake_property(_vars VARIABLES)
foreach(_var ${_vars})
string(TOUPPER ${lib} lib_upper)
if(_var MATCHES "^WITH_LIB_${lib_upper}_EXAMPLE_([A-Za-z]+)$")
message(STATUS "Number of examples found: ${CMAKE_MATCH_COUNT}")
message(STATUS "Number 1 found: ${CMAKE_MATCH_0}")
endif()</pre>
<pre> endforeach()</pre>
<p>Now i've two problem - the CMAKE_MATCH_0 contains the hole string
and not only the part the is in the (), i need only the part from
the () - is there another command i can use for this ?</p>
<p><br>
</p>
On 04.06.19 18:47, Kornel Benko wrote:<br>
<blockquote type="cite" cite="mid:22289096.PHOEFkUO95@amd64">
<pre class="moz-quote-pre" wrap="">Am Dienstag, 4. Juni 2019, 18:10:19 CEST schrieb Steven Truppe:
</pre>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Hello again,
i've the following variable defined:
set(WITH_LIB_GLAD_EXAMPLE_BASIC 1)
And the if the line
foreach(_var VARIABLES)
if(_var MATCHES "WITH_LIB_GLAD_EXAMPLE_([A-Za-z]+)")
message(STATUS "Found a match")
endforeach()
I never get the message "Found match", what am i doing wrong here ??
</pre>
</blockquote>
<pre class="moz-quote-pre" wrap="">
What about the attached?
Kornel
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
</blockquote>
</body>
</html>