chore: move asset header generation to new ExtractAssetsHeaders target (#2705)

* add dedicated build target for extracting asset headers conditionally

* dont gen otr when generating headers

* simplify python array
This commit is contained in:
Adam Bird 2023-04-14 09:54:56 -04:00 committed by GitHub
commit 1861335cf0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 31 additions and 5 deletions

View file

@ -105,6 +105,7 @@ endif()
find_package(Python3 COMPONENTS Interpreter)
# Target to generate OTRs
add_custom_target(
ExtractAssets
# CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions
@ -117,6 +118,15 @@ add_custom_target(
BYPRODUCTS oot.otr ${CMAKE_SOURCE_DIR}/oot.otr oot-mq.otr ${CMAKE_SOURCE_DIR}/oot-mq.otr ${CMAKE_SOURCE_DIR}/soh.otr
)
# Target to generate headers
add_custom_target(
ExtractAssetHeaders
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --non-interactive --gen-headers
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
COMMENT "Generating asset headers..."
DEPENDS ZAPD
)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(ImageMagick COMPONENTS convert)
if (ImageMagick_FOUND)