From 6cced7872557fe92228114ce6bf55a30ef91e358 Mon Sep 17 00:00:00 2001 From: Frank Benkstein Date: Mon, 19 Feb 2018 17:50:16 +0100 Subject: 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. --- Modules/FindLua.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/Modules/FindLua.cmake b/Modules/FindLua.cmake index b59b9b3..7eba206 100644 --- a/Modules/FindLua.cmake +++ b/Modules/FindLua.cmake @@ -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 -- cgit v0.12