Browse Source

Meta: Assets in separate CMakeLists.txt

master
Riyyi 1 year ago
parent
commit
2b0635ed69
  1. 2
      .gitmodules
  2. 5
      CMakeLists.txt
  3. 4
      assets/CMakeLists.txt
  4. 3
      src/inferno/scene/scene.cpp

2
.gitmodules vendored

@ -16,6 +16,6 @@
[submodule "inferno/vendor/stb/stb"]
path = vendor/stb/stb
url = https://github.com/nothings/stb
[submodule "vendor/ruc"]
[submodule "inferno/vendor/ruc"]
path = vendor/ruc
url = https://github.com/Riyyi/ruc

5
CMakeLists.txt

@ -69,10 +69,7 @@ add_subdirectory("src")
# ------------------------------------------
# Assets target
add_custom_target(${ENGINE}-assets
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/cmake/copy-assets.cmake
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_dependencies(${ENGINE} ${ENGINE}-assets)
add_subdirectory("assets")
# ------------------------------------------
# Examples target

4
assets/CMakeLists.txt

@ -0,0 +1,4 @@
add_custom_target(${ENGINE}-assets
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_SOURCE_DIR}/../cmake/copy-assets.cmake
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_dependencies(${ENGINE} ${ENGINE}-assets)

3
src/inferno/scene/scene.cpp

@ -64,8 +64,9 @@ void Scene::initialize()
if (cameraJson.exists("script")) {
auto& cameraScript = cameraJson.at("script");
if (cameraScript.exists("type") && cameraScript.exists("name")) {
auto name = cameraScript.at("name").get<std::string>();
if (cameraScript.at("type").get<std::string>() == "lua") {
addComponent<LuaScriptComponent>(camera, cameraScript.at("name").get<std::string>());
addComponent<LuaScriptComponent>(camera, name);
}
else {
addComponent<NativeScriptComponent>(camera, name);

Loading…
Cancel
Save