title: Issue linking Lua locally with CMake
body: <p>I know this general question has been asked before, but I have a specific unanswered issue that I can't find already posted.</p>
  
  <p>I'm trying to link a local git submodule of the Lua source in <code>myproj/dependencies/lua</code> to my <code>myproj/helloworld.c</code> file. I'm making it get the Lua in my local directory because I was having issues where Fedora could find my system Lua headers with the <code>FindLua.cmake</code> but Ubuntu couldn't. I imagine this problem will only be compounded when I try and bring macOS and Windows into the mix down the road.</p>
  
  <p>The <code>FindLua.cmake</code> module is still useful, so I want to force it to <em>only</em> search in the <code>myproj/dependencies/lua</code> directory. Which to my understanding means setting <code>LUA_INCLUDE_DIRS</code>by hand in my <code>CMakeLists.txt</code>.</p>
  
  <p>So <strong>Issue A</strong> is  I've tried many iterations of the below syntax in most of the ways I could think of:</p>
  
  <p><code>set(LUA_INCLUDE_DIRS "{$CMAKE_SOURCE_DIR}/dependencies/lua")</code></p>
  
  <p>Yet <code>cmake .</code> doesn't output anything suggesting it found Lua, and then <code>make</code> fails with <code>fatal error: lua.h no such file or directory</code> </p>
  
  <p><strong>Issue B</strong> is that even once it does find it, it's going to find <a href="https://github.com/lua/lua" rel="nofollow noreferrer">this</a> which has to be compiled on cue from CMake in a way that it produces something it can use to link. Just running <code>make</code> on it only produces a single executable. I've seen some people linking the headers, and some people linking <code>.a</code> or <code>.so</code> files. It's unclear which of these I should use in this situation and why.</p>
  
  <p>(My reasoning in approaching Issue B this way is I want to ship Lua with the code, so that it can be compiled without having to install system Lua headers, update them to a new version, or hunt them down. It's going to be embedded in a C application. So it doesn't really need dynamic features) </p>
  
  <p>Just to be thorough, here's the rest of the <code>CMakeLists.txt</code>:</p>
  
  <pre><code>cmake_minimum_required(VERSION 3.5)
  project (learnopengl)
  set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
  set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
  set(CMAKE_INCLUDE_CURRENT_DIR ON)
  
  add_executable(learnopengl
      helloworld.c
  )
  
  add_subdirectory(dependencies/glfw)
  add_subdirectory(dependencies/glad)
  set(LUA_INCLUDE_DIRS "{$CMAKE_SOURCE_DIR}/dependencies/lua")
  
  find_package(Lua)
  if (LUA_FOUND)
      include_directories(${LUA_INCLUDE_DIRS})
      target_link_libraries (learnopengl ${LUA_LIBRARIES})
  endif (LUA_FOUND)
  
  target_link_libraries(learnopengl glad)
  target_link_libraries(learnopengl glfw)
  </code></pre>