<div class="gmail_quote">On Thu, May 5, 2011 at 7:08 AM, J.S. van Bethlehem <span dir="ltr">&lt;<a href="mailto:j.s.van.bethlehem@astro.rug.nl">j.s.van.bethlehem@astro.rug.nl</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello,<br>
<br>
Today I was trying something along the following lines:<br>
in CMakeLists.txt<br>
set(BASENAME some_text)<br>
set(${BASENAME}_DIR /some/path)<br>
set(${BASENAME}_SHARE /some/other/path)<br>
set(${BASENAME}_INCLUDES file1.h;file2.h;file3.h)<br>
configure_file(<a href="http://config.h.in" target="_blank">config.h.in</a> config.h @ONLY)<br>
<br>
and in <a href="http://config.h.in" target="_blank">config.h.in</a> do:<br>
set(INSTALL_PATH @@BASENAME@_DIR@)<br>
foreach(incl ${INSTALL_PATH})<br>
# do something<br>
endforeach(incl ${INSTALL_PATH})<br>
<br>
My expectation was that first @BASENAME@ would evaluate to &#39;some_text&#39; after which @some_text_DIR@ would evaluate to the respective value. This fails, so the obvious question is: am I trying something that is simply not possible, or should I use different syntax to accomplish this?<br>

<br>
Yours sincerely,<br>
Jakob van Bethlehem<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</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">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br><br>Why are you putting CMake script code into the file <a href="http://config.h.in">config.h.in</a>?<br><br>Seems like you want to generate the .<a href="http://h.in">h.in</a> file based on a CMake loop, and *then* use it in a configure_file call...<br>
<br>What do you want the final .h file to look like?<br><br>