From 5d5afc71593f09f3509a94e529a4b9009b7b07d0 Mon Sep 17 00:00:00 2001 From: briaguya <70942617+briaguya-ai@users.noreply.github.com> Date: Sun, 2 Jun 2024 00:26:31 -0400 Subject: [PATCH] add `ExtractAssets` target --- CMakeLists.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21cb9dd7..7f39cb6e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -487,3 +487,20 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang") ) endif() endif() + +include(ExternalProject) +ExternalProject_Add(Torch + SOURCE_DIR ${CMAKE_SOURCE_DIR}/Torch + CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/Torch +) +ExternalProject_Get_Property(Torch install_dir) +set(TORCH_EXECUTABLE ${install_dir}/src/Torch-build/torch) +add_custom_target( + ExtractAssets + DEPENDS Torch + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND ${TORCH_EXECUTABLE} otr baserom.us.z64 + # COMMAND ${TORCH_EXECUTABLE} pack assets sm64.otr + COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/smcube.otr" "${CMAKE_BINARY_DIR}/smcube.otr" + # COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/sm64.otr" "${CMAKE_BINARY_DIR}/sm64.otr" +)