Skip to content

Commit

Permalink
Extract and install icon from metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
Holt59 committed Aug 9, 2024
1 parent dfc8964 commit 2cdf7fd
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mo2_extension.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ function(mo2_configure_extension)

file(READ ${METADATA_FILE} JSON_METADATA)
string(JSON extension_identifier GET ${JSON_METADATA} id)
string(JSON extension_icon ERROR_VARIABLE extension_icon_error GET ${JSON_METADATA} icon)

set(MO2_EXTENSION_ID ${extension_identifier} PARENT_SCOPE)

install(FILES ${METADATA_FILE}
DESTINATION ${MO2_INSTALL_BIN}/extensions/${extension_identifier}/)

if (NOT (${extension_icon} EQUAL "icon-NOTFOUND"))
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/${extension_icon}
DESTINATION ${MO2_INSTALL_BIN}/extensions/${extension_identifier}/)
endif()

endfunction()

0 comments on commit 2cdf7fd

Please sign in to comment.