CMake: Move vendor directory to the project root
This commit is contained in:
+7
-7
@@ -1,21 +1,21 @@
|
|||||||
[submodule "inferno/vendor/glfw"]
|
[submodule "inferno/vendor/glfw"]
|
||||||
path = inferno/vendor/glfw
|
path = vendor/glfw
|
||||||
url = https://github.com/glfw/glfw
|
url = https://github.com/glfw/glfw
|
||||||
[submodule "inferno/vendor/glm"]
|
[submodule "inferno/vendor/glm"]
|
||||||
path = inferno/vendor/glm
|
path = vendor/glm
|
||||||
url = https://github.com/g-truc/glm
|
url = https://github.com/g-truc/glm
|
||||||
[submodule "inferno/vendor/json"]
|
[submodule "inferno/vendor/json"]
|
||||||
path = inferno/vendor/json
|
path = vendor/json
|
||||||
url = https://github.com/nlohmann/json
|
url = https://github.com/nlohmann/json
|
||||||
[submodule "inferno/vendor/entt"]
|
[submodule "inferno/vendor/entt"]
|
||||||
path = inferno/vendor/entt
|
path = vendor/entt
|
||||||
url = https://github.com/skypjack/entt
|
url = https://github.com/skypjack/entt
|
||||||
[submodule "inferno/vendor/lua/lua"]
|
[submodule "inferno/vendor/lua/lua"]
|
||||||
path = inferno/vendor/lua/lua
|
path = vendor/lua/lua
|
||||||
url = https://github.com/lua/lua
|
url = https://github.com/lua/lua
|
||||||
[submodule "inferno/vendor/sol2"]
|
[submodule "inferno/vendor/sol2"]
|
||||||
path = inferno/vendor/sol2
|
path = vendor/sol2
|
||||||
url = https://github.com/ThePhD/sol2
|
url = https://github.com/ThePhD/sol2
|
||||||
[submodule "inferno/vendor/stb/stb"]
|
[submodule "inferno/vendor/stb/stb"]
|
||||||
path = inferno/vendor/stb/stb
|
path = vendor/stb/stb
|
||||||
url = https://github.com/nothings/stb
|
url = https://github.com/nothings/stb
|
||||||
|
|||||||
@@ -54,6 +54,12 @@ endif()
|
|||||||
|
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
|
# ------------------------------------------
|
||||||
|
# Engine dependencies target
|
||||||
|
|
||||||
|
# Add engine target to project
|
||||||
|
add_subdirectory("${CMAKE_SOURCE_DIR}/vendor")
|
||||||
|
|
||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
# Engine target
|
# Engine target
|
||||||
|
|
||||||
|
|||||||
+9
-24
@@ -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")
|
file(GLOB_RECURSE ENGINE_SOURCES "src/*.cpp")
|
||||||
set(ENGINE_SOURCES ${GLAD} ${LUA} ${ENGINE_SOURCES})
|
|
||||||
|
|
||||||
add_library(${ENGINE} ${ENGINE_SOURCES})
|
add_library(${ENGINE} ${ENGINE_SOURCES})
|
||||||
target_include_directories(${ENGINE} PRIVATE
|
target_include_directories(${ENGINE} PRIVATE
|
||||||
"src"
|
"src"
|
||||||
"vendor/entt/src"
|
"${CMAKE_SOURCE_DIR}/vendor/entt/src"
|
||||||
"vendor/glad/include"
|
"${CMAKE_SOURCE_DIR}/vendor/glad/include"
|
||||||
"vendor/glfw/include"
|
"${CMAKE_SOURCE_DIR}/vendor/glfw/include"
|
||||||
"vendor/glm"
|
"${CMAKE_SOURCE_DIR}/vendor/glm"
|
||||||
"vendor/json/include"
|
"${CMAKE_SOURCE_DIR}/vendor/json/include"
|
||||||
"vendor/lua"
|
"${CMAKE_SOURCE_DIR}/vendor/lua"
|
||||||
"vendor/sol2/include"
|
"${CMAKE_SOURCE_DIR}/vendor/sol2/include"
|
||||||
"vendor/stb")
|
"${CMAKE_SOURCE_DIR}/vendor/stb")
|
||||||
target_link_libraries(${ENGINE} glfw)
|
target_link_libraries(${ENGINE} ${ENGINE}-dependencies)
|
||||||
|
|
||||||
# ------------------------------------------
|
# ------------------------------------------
|
||||||
|
|
||||||
|
|||||||
Vendored
+21
@@ -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)
|
||||||
Vendored
Reference in New Issue
Block a user