Ugh. This is a *horrible* bug. And it looks like it's my fault... Sometimes it only takes 18 months or so for these things to come to light. :-(<div><br></div><div>To get it to work, put "FOLLOW_SYMLINKS" *before* the RELATIVE keyword. The implementation has a bug that treats FOLLOW_SYMLINKS as one of the globbing expressions if it occurs after RELATIVE. Doesn't help that the documentation for the file command encourages you to put FOLLOW_SYMLINKS after RELATIVE...</div>
<div><br></div><div>The other bug is a missing "break" when the policy value is set to OLD. You are correct: it should not warn you if you explicitly set it to OLD.</div><div><br></div><div>Could you file a bug for this issue in the bug tracker and attach a small .tar.gz of an example project that demonstrates the problem? Reply with the bug number if you're able to do that: I'll make sure to assign it to myself.<br>
<br></div><div>Thanks, (and sorry for the hassle),</div><div>David Cole</div><div><br></div><div><br><div class="gmail_quote">On Wed, Mar 17, 2010 at 9:17 PM, Chris Hillery <span dir="ltr"><<a href="mailto:chillery-cmake@lambda.nu">chillery-cmake@lambda.nu</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">I couldn't find any way to search the CMake bug tracker, so it's entirely possible this is already filed. I didn't see any reference to it in my mailing list archives, however.<br>
<br>Policy CMP0009 is documented (when set to NEW) to make FILE(GLOB_RECURSE) only follow symlinks if the FOLLOW_SYMLINKS flag is set.<br>
<br>However, in practice, I find that when CMP0009 is set to NEW, symlinks are not followed *even if* FOLLOW_SYMLINKS is specified.<br><br><span style="font-family:courier new,monospace">IF(COMMAND cmake_policy)</span><br style="font-family:courier new,monospace">
<span style="font-family:courier new,monospace"> CMAKE_POLICY(SET CMP0009 NEW)</span><br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">ENDIF(COMMAND cmake_policy)</span><br style="font-family:courier new,monospace">
<br style="font-family:courier new,monospace"><span style="font-family:courier new,monospace">FILE(GLOB_RECURSE TESTFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" FOLLOW_SYMLINKS "*.xq")</span><br style="font-family:courier new,monospace">
<br>In this case, the current source directory contains a symlink to a subdirectory containing *.xq files, and TESTFILES willl not contain those paths.<br><br>If however I set the policy CMP0009 to OLD, I'll get all those files, the same as if I do not set the policy to anything, *In either case*, I get a warning message about setting it, but the symlinks will be followed. (This is another bug - explicitly setting the policy to OLD should disable the warning, shouldn't it?)<br>
<br>As mentioned in the subject, this is with CMake 2.6-patch 4. I'm afraid I have not yet been able to test this out with CMake 2.8. I don't know if Kitware does maintenance releases for previous revisions.<br><br>
Ceej<br>aka Chris Hillery<br>
<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></div>