Просмотр исходного кода

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.
Frank Benkstein 8 лет назад
Родитель
Сommit
6cced78725
1 измененных файлов с 1 добавлено и 0 удалено
  1. 1 0
      Modules/FindLua.cmake

+ 1 - 0
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