CMAKE can't find Lua on Windows. Works fine on Linux.

The command I'm using works fine on Linux, but I need to port the project to run on Windows as well, and I can't get CMake to find all of the Lua directories.  I'm using


I receive a message about finding a suitable exact version, but can't get the lib folder, even if I give a direct path to the lib folder. (tried renaming the lib folder as well) I'm using Cygwin, and have lua5.3.exp, lua5.3.lib, lua5.3-static.lib, luac.exp, and luac.lib.  


Maybe, I didn't build Lua correctly, or grab the right version for Windows? I see that there's a Cygwin package up on Sourceforge. Is that built correctly? I have a feeling I'm going to need to statically link in the long run, and not really sure how to set that up for Cygwin. Thanks.

Comment actions Permalink

Hi Michael.

Could you please open CMake Cache tab and verify that LUA_LIBRARIES variable is present and points to the location you are expecting. Please note that FIND_PACKAGE doesn't update found variables so you might have to invalidate CMake Cache. Also please specify which error message you are getting?

Comment actions Permalink

I managed to resolve the issue. It turns out the libraries I had were built with nonstandard names. Just grabbed a different set of binaries and it worked.

The one thing I did notice was if I set LUA_DIR as an environment variable on Windows (Even if I put it in the path as well) I needed to reboot the computer for CLion to see it.  Is this as intended?


Please sign in to leave a comment.