title: Statically Linking Lua in Cmake
body: <p>I have a project that uses GLFW, GLEW, GLM, and Lua. Previously I was using a Makefile on my Linux environment which linked the libraries, some static, some dynamic.</p>
  
  <p>Based on this <a href="https://github.com/andersonfreitas/opengl-boilerplate" rel="nofollow">boilerplate project</a> I can compile and link GLFW, GLEW, and GLM to my project with Cmake. However I am having trouble with linking lua which previously just required "-llua" on Linux. </p>
  
  <p>I can build lua just fine with Cmake and when building my project it does print out that liblua was built however soon after it complains about missing luaconf.h. Probably because it doesn't exist, luaconf.h.in exists and the following line from the lua CMakeLists.txt seems to generate luaconf.h:</p>
  
  <pre><code>configure_file ( src/luaconf.h.in ${CMAKE_CURRENT_BINARY_DIR}/luaconf.h )
  </code></pre>
  
  <p>What's the cleanest way to deal with this? I can think of some hacky ways but I'm wondering if there's something within CMake that can handle it or if someone else has experience linking lua in this way with CMake.</p>
  
  <p>This is <a href="http://pastebin.com/6L0fwTAU" rel="nofollow">my CMakeLists.txt</a>, I would post the lua one too but I don't have enough rep.</p>