From c803ff65cee0001e405dce30b3716ae6e40222a1 Mon Sep 17 00:00:00 2001 From: th-2021 <90853655+th-2021@users.noreply.github.com> Date: Tue, 9 Aug 2022 01:58:43 +0200 Subject: [PATCH] fix path to ZAPD (#1092) --- CMake/genscript.cmake | 5 +++++ CMakeLists.txt | 10 ++-------- 2 files changed, 7 insertions(+), 8 deletions(-) create mode 100644 CMake/genscript.cmake diff --git a/CMake/genscript.cmake b/CMake/genscript.cmake new file mode 100644 index 00000000000..10089a4fd77 --- /dev/null +++ b/CMake/genscript.cmake @@ -0,0 +1,5 @@ +file(READ ${CMAKE_CURRENT_SOURCE_DIR}/extract_assets.py filedata) +string(REGEX REPLACE "zapd_exe = .*exec_cmd =" "zapd_exe = \"${program}\"\n exec_cmd =" filedata "${filedata}") +file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/extract_assets_cmake2.py" "${filedata}") +file(CHMOD "${CMAKE_CURRENT_SOURCE_DIR}/extract_assets_cmake2.py" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) + diff --git a/CMakeLists.txt b/CMakeLists.txt index c9698c68f34..ef21271f5e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -134,17 +134,11 @@ if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux") INSTALL(PROGRAMS "${CMAKE_SOURCE_DIR}/scripts/linux/appimage/soh.sh" DESTINATION . COMPONENT appimage) endif() -file(READ ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py filedata) -string(REGEX REPLACE "../ZAPDTR/ZAPD.out" "${CMAKE_BINARY_DIR}/ZAPD/ZAPD.out" filedata "${filedata}") -string(REGEX REPLACE "x64" "..\\\\\\\\x64" filedata "${filedata}") -string(REGEX REPLACE "Release" "${CMAKE_BUILD_TYPE}" filedata "${filedata}") -file(WRITE "${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets_cmake2.py" "${filedata}") -file(CHMOD "${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets_cmake2.py" PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_WRITE GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - find_package(Python3 COMPONENTS Interpreter) add_custom_target( ExtractAssets + COMMAND ${CMAKE_COMMAND} -Dprogram=$ -P ${CMAKE_SOURCE_DIR}/CMake/genscript.cmake COMMAND ${CMAKE_COMMAND} -E rm -f oot.otr COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets_cmake2.py COMMAND ${CMAKE_COMMAND} -E copy oot.otr ${CMAKE_SOURCE_DIR} @@ -152,7 +146,7 @@ add_custom_target( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter COMMENT "Running asset extraction..." DEPENDS ZAPD - + BYPRODUCTS oot.otr ${CMAKE_SOURCE_DIR}/oot.otr ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets_cmake2.py ) if(CMAKE_SYSTEM_NAME MATCHES "Linux")