diff --git a/.gitmodules b/.gitmodules index 1c4ef8f..f71aab3 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,6 @@ [submodule "external/glfw"] path = external/glfw url = https://github.com/glfw/glfw -[submodule "external/lua"] - path = external/lua - url = https://github.com/lua/lua +[submodule "external/lua-cmake"] + path = external/lua-cmake + url = https://github.com/lubgr/lua-cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index a1f8509..664b70a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,23 +9,15 @@ set(states abstractAppState.cpp) set(core inputManager.cpp mapping.h stateManager.cpp luaManager.cpp) set(util util.cpp) -set(GLFW_DIR vb01/external/glfw) -set(LUA_DIR external/lua) - -include_directories(../${GLFW_DIR}/include/GLFW) - -set(LUA_LIB_DIR ${LUA_DIR}) -include_directories(${LUA_DIR}) -link_directories(${LUA_DIR}) - -add_library(gameBase STATIC ${states} ${core} ${util}) -set(GLFW_DIR ../vb01/external/glfw) set(LIB_NAME gameBase) +add_library(${LIB_NAME} STATIC ${states} ${core} ${util}) -set(GLFW_LIB_DIR ../vb01/build/external/glfw/src) +set(GLFW_DIR external/glfw) +set(GLFW_LIB_DIR build/external/glfw/src) target_include_directories(${LIB_NAME} PUBLIC ${GLFW_DIR}/include/GLFW) target_link_directories(${LIB_NAME} PUBLIC ${GLFW_LIB_DIR}) -target_link_libraries(${LIB_NAME} lua) -target_link_libraries(gameBase glfw) - +set(LUA_DIR external/lua-cmake) +add_subdirectory(${LUA_DIR}) +target_include_directories(${LIB_NAME} PUBLIC ${LUA_DIR}/external/upstream) +target_link_libraries(${LIB_NAME} glfw lua::lib) diff --git a/external/lua b/external/lua deleted file mode 160000 index 8426d9b..0000000 --- a/external/lua +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8426d9b4d4df1da3c5b2d759e509ae1c50a86667 diff --git a/external/lua-cmake b/external/lua-cmake new file mode 160000 index 0000000..ca210c5 --- /dev/null +++ b/external/lua-cmake @@ -0,0 +1 @@ +Subproject commit ca210c56ae41ff13b20490cca8be5ead47b24196 diff --git a/luaManager.h b/luaManager.h index fcd0826..f65fdd5 100644 --- a/luaManager.h +++ b/luaManager.h @@ -1,9 +1,11 @@ #ifndef LUA_MANAGER_H #define LUA_MANAGER_H -#include -#include -#include +extern "C"{ + #include + #include + #include +} #include #include