FindLua.cmake assumes CMP0012 set to NEW
The FindLua.cmake that is included with CMake 3.12-rc2 contains fixes for #17999 (closed) . These fixes use code like
function(_lua_find_header) # ... while (TRUE) # Find the next header to test. Check each possible subdir in order # ... endwhile() endfunction()
This use of TRUE in a Boolean context assumes that CMP0012 is set to NEW. If it isn't, TRUE may not be recognized as a Boolean truthy value, and the while is skipped. Since no warning is generated (see #18141) this is hard-to-diagnose, except that older code now fails to find Lua where the 3.11 module did.
Adding (inside the _lua_find_header function):
cmake_policy(PUSH) cmake_policy(SET CMP0012 NEW)
makes the while loop work, and finds Lua as before. Doing the policy pop is a bit tricky because of multiple returns; it may be easiest to add a wrapper function changing the policy for the code in that function.