<div dir="ltr"><div><div>Fixed, please review it again (patches are attached to <a href="https://gitlab.kitware.com/cmake/cmake/issues/15756">#15756</a>) .<br></div>Erase variable from cache is necessary, I think (see comment at gitlab).<br></div><div>Ignoring of  LUA_INCLUDE_DIR was my fault, fixed. For now I use this variable as a recommendation, i.e. if there is no lua.h with compatible version in this dir, search will be continue in another dirs and in case of success this variable will be changed.<br></div><div><br></div>Sorry for delay.<br><div><div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">2016-05-09 16:32 GMT+03:00 Brad King <span dir="ltr"><<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 05/06/2016 09:02 AM, ivan Ivanov wrote:<br>
> Fix for <a href="https://cmake.org/Bug/view.php?id=15756" rel="noreferrer" target="_blank">https://cmake.org/Bug/view.php?id=15756</a><br>
<br>
Thanks for working on this.<br>
<br>
Please split the patch to first perform refactoring like moving<br>
the version extraction into a helper function.  Then the actual<br>
logic change will be easier to see in the second commit.  Also<br>
please name helper functions as "_lua_...".  We might as well<br>
rename the set_lua_version_vars helper while we're at it.<br>
<br>
> +    unset(LUA_INCLUDE_PREFIX CACHE)<br>
> +    find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h<br>
<br>
This renames the cache entry from LUA_INCLUDE_DIR to<br>
LUA_INCLUDE_PREFIX and also stops re-using an already-found<br>
or user-provided value.  Neither of these follows CMake conventions.<br>
I don't follow why this change is needed.  Using version-specific<br>
paths in a normal find_path(LUA_INCLUDE_DIR ...) should be enough.<br>
<br>
Thanks,<br>
-Brad<br>
</blockquote></div><br></div>