I followed the instructions here and set up Lua and Luarocks from scratch, with Mingw. Everything worked fine and I was able to install rocks, including ones which require c
The command looks mostly correct, but I think the cmake command needs -G "MSYS Makefiles"
option to use mingw instead of VS. You may also need to pull the most recent torch version as it includes several changes that fix some compilation issues with mingw.
Note that I haven't tested the changes with LuaRocks and not sure how to pass that additional option to it, but you should be able to run the same command manually to get the desired result (I compiled it from the command line).
cmake appears to use Visual Studio 9 2008, but it "wrongly" uses mingw32-make.exe instead of maybe... nmake.exe.
You could run this command:"c:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin\vcvars32.bat"
(adapt to your visual studio path) in the same console, before you execute the luarocks
command. Now, cmake should use nmake.