Opt-in for an easy-way CMake target to create soh.otr file (#3057)

* use a convenient cmake target for gen soh otr

* Update generate-builds.yml

* Apply for all conditions

* grandma change
This commit is contained in:
AltoXorg 2023-08-16 08:26:23 +08:00 committed by GitHub
commit 6923c2d3c0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 9 deletions

View file

@ -132,6 +132,18 @@ add_custom_target(
DEPENDS ZAPD
)
# Target to generate only soh.otr
add_custom_target(
GenerateSohOtr
# CMake versions prior to 3.17 do not have the rm command, use remove instead for older versions
COMMAND ${CMAKE_COMMAND} -E $<IF:$<VERSION_LESS:${CMAKE_VERSION},3.17>,remove,rm> -f soh.otr
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter/extract_assets.py -z "$<TARGET_FILE:ZAPD>" --norom
COMMAND ${CMAKE_COMMAND} -DSYSTEM_NAME=${CMAKE_SYSTEM_NAME} -DTARGET_DIR="$<TARGET_FILE_DIR:ZAPD>" -DSOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -DBINARY_DIR=${CMAKE_BINARY_DIR} -DONLYSOHOTR=On -P ${CMAKE_CURRENT_SOURCE_DIR}/copy-existing-otrs.cmake
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/OTRExporter
COMMENT "Generating soh.otr..."
DEPENDS ZAPD
)
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
find_package(ImageMagick COMPONENTS convert)
if (ImageMagick_FOUND)