[cmake-developers] proposal of fix for FindLua

Brad King brad.king at kitware.com
Mon May 9 09:32:21 EDT 2016


On 05/06/2016 09:02 AM, ivan Ivanov wrote:
> Fix for https://cmake.org/Bug/view.php?id=15756

Thanks for working on this.

Please split the patch to first perform refactoring like moving
the version extraction into a helper function.  Then the actual
logic change will be easier to see in the second commit.  Also
please name helper functions as "_lua_...".  We might as well
rename the set_lua_version_vars helper while we're at it.

> +    unset(LUA_INCLUDE_PREFIX CACHE)
> +    find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h

This renames the cache entry from LUA_INCLUDE_DIR to
LUA_INCLUDE_PREFIX and also stops re-using an already-found
or user-provided value.  Neither of these follows CMake conventions.
I don't follow why this change is needed.  Using version-specific
paths in a normal find_path(LUA_INCLUDE_DIR ...) should be enough.

Thanks,
-Brad


More information about the cmake-developers mailing list