I have a batch file that I use that sets SDL2DIR, etc., to the correct paths for use with OpenMW, since I primarily work from the command prompt. I have no idea how CMake decides to update the cache if the environment variables change, since I don't think it caches the environment variables.