diff --git a/CMakeLists.txt b/CMakeLists.txt index 33311c73..fdbc810a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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/$/torch) +ExternalProject_Get_Property(torch install_dir) +if (MSVC) + set(TORCH_EXECUTABLE ${install_dir}/src/torch-build/$/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