From 660c3ec3b05cc5fa359f0d655c630920015b530c Mon Sep 17 00:00:00 2001 From: Adam Bird Date: Thu, 13 Apr 2023 18:37:10 -0400 Subject: [PATCH] fix soh otr asset building not detecting textures (#2702) --- CMakeLists.txt | 2 +- OTRExporter/OTRExporter/Main.cpp | 4 ++-- copy-existing-otrs.cmake | 3 +++ 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7f3c32572..b88d9760a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,7 @@ find_package(Python3 COMPONENTS Interpreter) add_custom_target( ExtractAssets # CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions - COMMAND ${CMAKE_COMMAND} -E $,remove,rm> -f oot.otr oot-mq.otr + COMMAND ${CMAKE_COMMAND} -E $,remove,rm> -f oot.otr oot-mq.otr soh.otr COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$" --non-interactive COMMAND ${CMAKE_COMMAND} -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter diff --git a/OTRExporter/OTRExporter/Main.cpp b/OTRExporter/OTRExporter/Main.cpp index fb49210b9..ac8c60d4a 100644 --- a/OTRExporter/OTRExporter/Main.cpp +++ b/OTRExporter/OTRExporter/Main.cpp @@ -119,8 +119,8 @@ static void ExporterProgramEnd() if (splitPath.size() >= 3) { - const std::string& extension = splitPath.at(splitPath.size() - 1); - const std::string& format = splitPath.at(splitPath.size() - 2); + const std::string extension = splitPath.at(splitPath.size() - 1); + const std::string format = splitPath.at(splitPath.size() - 2); splitPath.pop_back(); splitPath.pop_back(); std::string afterPath = std::accumulate(splitPath.begin(), splitPath.end(), std::string("")); diff --git a/copy-existing-otrs.cmake b/copy-existing-otrs.cmake index 007376d7b..b700e9de5 100644 --- a/copy-existing-otrs.cmake +++ b/copy-existing-otrs.cmake @@ -12,4 +12,7 @@ if(EXISTS ${SOURCE_DIR}/OTRExporter/soh.otr) endif() if(NOT EXISTS ${SOURCE_DIR}/oot.otr AND NOT EXISTS ${SOURCE_DIR}/oot-mq.otr) message(FATAL_ERROR, "No OTR files found.") +endif() +if(NOT EXISTS ${SOURCE_DIR}/soh.otr) + message(FATAL_ERROR, "No soh OTR found.") endif() \ No newline at end of file