<html><body bgcolor="#FFFFFF"><div>Yes, that works.</div><div><br></div><div>Now I just need to remove the last character if it is a forward slash. How can I do that?</div><div><br></div><div>Thanks,</div><div>Pablo Zurita.</div><div><br>Sent from my iPhone</div><div><br>On Mar 2, 2011, at 1:47 AM, Yuri Timenkov &lt;<a href="mailto:yuri@timenkov.ru">yuri@timenkov.ru</a>&gt; wrote:<br><br></div><div></div><blockquote type="cite"><div>Does get_filename_component help?<br><br><div class="gmail_quote">On Wed, Mar 2, 2011 at 6:17 AM, Pablo Zurita <span dir="ltr">&lt;<a href="mailto:pzurita@gmail.com"><a href="mailto:pzurita@gmail.com">pzurita@gmail.com</a></a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello everybody,<br>
<br>
I'm just getting started and I need some help dealing with strings in<br>
CMake. Basically what I have a bunch of strings such as the ones<br>
below:<br>
<br>
"Main.cpp"<br>
"Window/Example/Example.cpp"<br>
"Window/Window.cpp"<br>
<br>
What I need to do is create two strings for each, one is going to be<br>
the directory, so the output in order for the list above is:<br>
<br>
""<br>
"Window/Example"<br>
"Window"<br>
<br>
And the other string I need is the file itself. So the output for that would be<br>
<br>
"Main.cpp"<br>
"Example.cpp"<br>
"Window.cpp"<br>
<br>
Since I'm processing each one by one it doesn't matter if there are collisions.<br>
<br>
As you can see all I need to is find the first forward slash on the<br>
string reading from right to left, and then put what's on the left of<br>
that string on one variable, and what is to the right in another.<br>
<br>
Does anybody know how I can do that?<br>
<br>
Thanks,<br>
Pablo Zurita.<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank"><a href="http://www.kitware.com">www.kitware.com</a></a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank"><a href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a></a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank"><a href="http://www.cmake.org/Wiki/CMake_FAQ">http://www.cmake.org/Wiki/CMake_FAQ</a></a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank"><a href="http://www.cmake.org/mailman/listinfo/cmake">http://www.cmake.org/mailman/listinfo/cmake</a></a><br>
</blockquote></div><br>
</div></blockquote></body></html>