Update CMakeLists.txt

This commit is contained in:
coco875 2024-12-06 23:00:50 +01:00 committed by Alejandro Asenjo Nitti
parent bff2324fae
commit f40cdac39e

View File

@ -530,16 +530,20 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang|AppleClang")
endif()
include(ExternalProject)
ExternalProject_Add(Torch
PREFIX Torch
ExternalProject_Add(torch
PREFIX torch
SOURCE_DIR ${CMAKE_SOURCE_DIR}/tools/Torch
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_BINARY_DIR}/Torch
)
ExternalProject_Get_Property(Torch install_dir)
set(TORCH_EXECUTABLE ${install_dir}/src/Torch-build/$<CONFIGURATION>/torch)
ExternalProject_Get_Property(torch install_dir)
if (MSVC)
set(TORCH_EXECUTABLE ${install_dir}/src/torch-build/$<CONFIGURATION>/torch)
else()
set(TORCH_EXECUTABLE ${install_dir}/src/torch-build/torch)
endif()
add_custom_target(
ExtractAssets
DEPENDS Torch
DEPENDS torch
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
COMMAND ${TORCH_EXECUTABLE} header -o baserom.us.uncompressed.z64
COMMAND ${TORCH_EXECUTABLE} otr baserom.us.uncompressed.z64