fix: alot of stuff changed. Mostly bugfixxes / architechture changes
This commit is contained in:
+38
-14
@@ -35,28 +35,52 @@ target_link_libraries(lightkeeper PRIVATE destrum::destrum)
|
||||
|
||||
set(ASSETS_SRC_DIR "${CMAKE_CURRENT_LIST_DIR}/assets_src")
|
||||
set(ASSETS_RUNTIME_DIR "${CMAKE_CURRENT_LIST_DIR}/assets_runtime")
|
||||
set(OUTPUT_GAME_ASSETS_DIR "${CMAKE_CURRENT_BINARY_DIR}/assets/game")
|
||||
set(OUTPUT_GAME_ASSETS_DIR "$<TARGET_FILE_DIR:lightkeeper>/assets/game")
|
||||
|
||||
if (WIN32)
|
||||
set(GAME_ASSET_INSTALL_COMMANDS
|
||||
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
||||
"${ASSETS_RUNTIME_DIR}" "${OUTPUT_GAME_ASSETS_DIR}")
|
||||
else()
|
||||
set(GAME_ASSET_INSTALL_COMMANDS
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink
|
||||
"${ASSETS_RUNTIME_DIR}" "${OUTPUT_GAME_ASSETS_DIR}")
|
||||
endif()
|
||||
|
||||
add_custom_command(TARGET lightkeeper POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${CMAKE_CURRENT_BINARY_DIR}/assets"
|
||||
COMMAND ${CMAKE_COMMAND} -E make_directory "${OUTPUT_GAME_ASSETS_DIR}/.."
|
||||
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -rf "${CMAKE_CURRENT_BINARY_DIR}/assets/game"
|
||||
COMMAND ${CMAKE_COMMAND} -E create_symlink "${ASSETS_RUNTIME_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/assets/game"
|
||||
COMMAND ${CMAKE_COMMAND} -E rm -rf "${OUTPUT_GAME_ASSETS_DIR}"
|
||||
${GAME_ASSET_INSTALL_COMMANDS}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
file(GLOB_RECURSE GAME_ASSET_SOURCES CONFIGURE_DEPENDS
|
||||
"${ASSETS_SRC_DIR}/*")
|
||||
|
||||
add_custom_target(_internal_clean_game_assets
|
||||
COMMAND TheChef
|
||||
--input "${ASSETS_SRC_DIR}"
|
||||
--output "${ASSETS_RUNTIME_DIR}"
|
||||
--clean
|
||||
COMMAND TheChef
|
||||
--input "${ASSETS_SRC_DIR}"
|
||||
--output "${ASSETS_RUNTIME_DIR}"
|
||||
--clean
|
||||
DEPENDS TheChef
|
||||
)
|
||||
|
||||
add_custom_target(_internal_cook_game_assets ALL
|
||||
COMMAND TheChef
|
||||
--input "${ASSETS_SRC_DIR}"
|
||||
--output "${ASSETS_RUNTIME_DIR}"
|
||||
DEPENDS TheChef
|
||||
add_custom_target(_internal_cook_game_assets
|
||||
COMMAND TheChef
|
||||
--input "${ASSETS_SRC_DIR}"
|
||||
--output "${ASSETS_RUNTIME_DIR}"
|
||||
--clean
|
||||
COMMAND TheChef
|
||||
--input "${ASSETS_SRC_DIR}"
|
||||
--output "${ASSETS_RUNTIME_DIR}"
|
||||
DEPENDS TheChef ${GAME_ASSET_SOURCES}
|
||||
VERBATIM
|
||||
)
|
||||
|
||||
destrum_cook_engine_assets(lightkeeper "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
add_dependencies(lightkeeper _internal_cook_game_assets)
|
||||
|
||||
destrum_cook_engine_assets(lightkeeper "${CMAKE_CURRENT_BINARY_DIR}")
|
||||
|
||||
install(TARGETS lightkeeper RUNTIME DESTINATION bin)
|
||||
install(DIRECTORY "${ASSETS_RUNTIME_DIR}/" DESTINATION "bin/assets/game")
|
||||
|
||||
Reference in New Issue
Block a user