diff options
author | Frank Benkstein <frank@benkstein.net> | 2018-02-19 16:50:16 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-02-20 21:13:45 (GMT) |
commit | 6cced7872557fe92228114ce6bf55a30ef91e358 (patch) | |
tree | 760c19e5f67ee1d39fa42c3d87d6291ee2892ab1 /Modules | |
parent | a99ff558afbee4578cf0fe05619978cbbbc03d38 (diff) | |
download | CMake-6cced7872557fe92228114ce6bf55a30ef91e358.zip CMake-6cced7872557fe92228114ce6bf55a30ef91e358.tar.gz CMake-6cced7872557fe92228114ce6bf55a30ef91e358.tar.bz2 |
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.
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/FindLua.cmake | 1 |
1 files changed, 1 insertions, 0 deletions
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 |