mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-11 08:20:18 -06:00
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:
committed by
Brad King
parent
a99ff558af
commit
6cced78725
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user