Browse Source

CMake: Move vendor directory to the project root

master
Riyyi 2 years ago
parent
commit
4468b1ffb9
  1. 14
      .gitmodules
  2. 6
      CMakeLists.txt
  3. 33
      inferno/CMakeLists.txt
  4. 21
      vendor/CMakeLists.txt
  5. 0
      vendor/entt
  6. 0
      vendor/glad/include/KHR/khrplatform.h
  7. 0
      vendor/glad/include/glad/glad.h
  8. 0
      vendor/glad/src/glad.c
  9. 0
      vendor/glfw
  10. 0
      vendor/glm
  11. 0
      vendor/json
  12. 0
      vendor/lua/lua
  13. 0
      vendor/sol2
  14. 0
      vendor/stb/stb

14
.gitmodules vendored

@ -1,21 +1,21 @@
[submodule "inferno/vendor/glfw"]
path = inferno/vendor/glfw
path = vendor/glfw
url = https://github.com/glfw/glfw
[submodule "inferno/vendor/glm"]
path = inferno/vendor/glm
path = vendor/glm
url = https://github.com/g-truc/glm
[submodule "inferno/vendor/json"]
path = inferno/vendor/json
path = vendor/json
url = https://github.com/nlohmann/json
[submodule "inferno/vendor/entt"]
path = inferno/vendor/entt
path = vendor/entt
url = https://github.com/skypjack/entt
[submodule "inferno/vendor/lua/lua"]
path = inferno/vendor/lua/lua
path = vendor/lua/lua
url = https://github.com/lua/lua
[submodule "inferno/vendor/sol2"]
path = inferno/vendor/sol2
path = vendor/sol2
url = https://github.com/ThePhD/sol2
[submodule "inferno/vendor/stb/stb"]
path = inferno/vendor/stb/stb
path = vendor/stb/stb
url = https://github.com/nothings/stb

6
CMakeLists.txt

@ -54,6 +54,12 @@ endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# ------------------------------------------
# Engine dependencies target
# Add engine target to project
add_subdirectory("${CMAKE_SOURCE_DIR}/vendor")
# ------------------------------------------
# Engine target

33
inferno/CMakeLists.txt

@ -1,32 +1,17 @@
# GLFW options
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
# Add GLFW target to project
add_subdirectory(vendor/glfw)
# Define engine source files
file(GLOB_RECURSE GLAD "vendor/glad/*.c")
file(GLOB LUA "vendor/lua/lua/*.c")
list(REMOVE_ITEM LUA "${CMAKE_CURRENT_SOURCE_DIR}/vendor/lua/lua/onelua.c") # Do not compile single file variant
list(REMOVE_ITEM LUA "${CMAKE_CURRENT_SOURCE_DIR}/vendor/lua/lua/ltests.c") # Do not compile internal debugging
list(REMOVE_ITEM LUA "${CMAKE_CURRENT_SOURCE_DIR}/vendor/lua/lua/lua.c") # Do not compile interpreter
file(GLOB_RECURSE ENGINE_SOURCES "src/*.cpp")
set(ENGINE_SOURCES ${GLAD} ${LUA} ${ENGINE_SOURCES})
add_library(${ENGINE} ${ENGINE_SOURCES})
target_include_directories(${ENGINE} PRIVATE
"src"
"vendor/entt/src"
"vendor/glad/include"
"vendor/glfw/include"
"vendor/glm"
"vendor/json/include"
"vendor/lua"
"vendor/sol2/include"
"vendor/stb")
target_link_libraries(${ENGINE} glfw)
"${CMAKE_SOURCE_DIR}/vendor/entt/src"
"${CMAKE_SOURCE_DIR}/vendor/glad/include"
"${CMAKE_SOURCE_DIR}/vendor/glfw/include"
"${CMAKE_SOURCE_DIR}/vendor/glm"
"${CMAKE_SOURCE_DIR}/vendor/json/include"
"${CMAKE_SOURCE_DIR}/vendor/lua"
"${CMAKE_SOURCE_DIR}/vendor/sol2/include"
"${CMAKE_SOURCE_DIR}/vendor/stb")
target_link_libraries(${ENGINE} ${ENGINE}-dependencies)
# ------------------------------------------

21
vendor/CMakeLists.txt vendored

@ -0,0 +1,21 @@
# GLFW options
set(GLFW_BUILD_DOCS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_TESTS OFF CACHE BOOL "" FORCE)
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
# Add GLFW target to project
add_subdirectory(glfw)
# Define engine source files
file(GLOB_RECURSE GLAD "glad/*.c")
file(GLOB LUA "lua/lua/*.c")
list(REMOVE_ITEM LUA "${CMAKE_CURRENT_SOURCE_DIR}/lua/lua/onelua.c") # Do not compile single file variant
list(REMOVE_ITEM LUA "${CMAKE_CURRENT_SOURCE_DIR}/lua/lua/ltests.c") # Do not compile internal debugging
list(REMOVE_ITEM LUA "${CMAKE_CURRENT_SOURCE_DIR}/lua/lua/lua.c") # Do not compile interpreter
set(ENGINE_SOURCES ${GLAD} ${LUA})
add_library(${ENGINE}-dependencies ${ENGINE_SOURCES})
target_include_directories(${ENGINE}-dependencies PRIVATE
"glad/include"
"lua")
target_link_libraries(${ENGINE}-dependencies glfw)

0
inferno/vendor/entt → vendor/entt vendored

0
inferno/vendor/glad/include/KHR/khrplatform.h → vendor/glad/include/KHR/khrplatform.h vendored

0
inferno/vendor/glad/include/glad/glad.h → vendor/glad/include/glad/glad.h vendored

0
inferno/vendor/glad/src/glad.c → vendor/glad/src/glad.c vendored

0
inferno/vendor/glfw → vendor/glfw vendored

0
inferno/vendor/glm → vendor/glm vendored

0
inferno/vendor/json → vendor/json vendored

0
inferno/vendor/lua/lua → vendor/lua/lua vendored

0
inferno/vendor/sol2 → vendor/sol2 vendored

0
inferno/vendor/stb/stb → vendor/stb/stb vendored

Loading…
Cancel
Save