FindLua: Fix error when LUA_INCLUDE_PREFIX is set as a variable

We use `LUA_INCLUDE_PREFIX` for the result of an internal `find_path`
call and unset the cache entry before each use.  Unset a plain variable
of this name too in case it was set by project code.  Otherwise the
`find_path` call may be skipped and the wrong value used, leading to
errors.
This commit is contained in:
Frank Benkstein
2018-02-19 17:50:16 +01:00
committed by Brad King
parent a99ff558af
commit 6cced78725

View File

@@ -122,6 +122,7 @@ endif ()
if (NOT LUA_VERSION_STRING)
foreach (subdir IN LISTS _lua_include_subdirs)
unset(LUA_INCLUDE_PREFIX CACHE)
unset(LUA_INCLUDE_PREFIX)
find_path(LUA_INCLUDE_PREFIX ${subdir}/lua.h
HINTS
ENV LUA_DIR