impr: Bundle default magic file with application

This commit is contained in:
WerWolv
2023-10-29 19:43:40 +01:00
parent 80ca6bf177
commit c444ad9280
8 changed files with 100 additions and 14 deletions

View File

@@ -45,7 +45,7 @@ macro(add_imhex_plugin)
)
# Setup a romfs for the plugin
set(LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_SOURCE_DIR}/romfs)
set(LIBROMFS_PROJECT_NAME ${IMHEX_PLUGIN_NAME})
add_subdirectory(${IMHEX_BASE_FOLDER}/lib/external/libromfs ${CMAKE_CURRENT_BINARY_DIR}/libromfs)
set_target_properties(${LIBROMFS_LIBRARY} PROPERTIES POSITION_INDEPENDENT_CODE ON)
@@ -54,3 +54,9 @@ macro(add_imhex_plugin)
# Add the new plugin to the main dependency list so it gets built by default
add_dependencies(imhex_all ${IMHEX_PLUGIN_NAME})
endmacro()
macro(add_romfs_resource input output)
configure_file(${input} ${CMAKE_CURRENT_BINARY_DIR}/romfs/${output} COPYONLY)
list(APPEND LIBROMFS_RESOURCE_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/romfs)
endmacro()