From 05ac8c2bdd000d27b38411db2223eabb649c318f Mon Sep 17 00:00:00 2001 From: Felix Morgner Date: Mon, 14 Jul 2025 21:29:10 +0000 Subject: build: reintroduce bootable ISO --- cmake/Modules/GenerateBootableIso.cmake | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 cmake/Modules/GenerateBootableIso.cmake (limited to 'cmake') diff --git a/cmake/Modules/GenerateBootableIso.cmake b/cmake/Modules/GenerateBootableIso.cmake new file mode 100644 index 0000000..368dcf6 --- /dev/null +++ b/cmake/Modules/GenerateBootableIso.cmake @@ -0,0 +1,22 @@ +include_guard(GLOBAL) + +function(target_generate_bootable_iso TARGET) + find_package("grub-mkrescue") + + file(GENERATE + OUTPUT "$/isofs/boot/grub/grub.cfg" + INPUT "arch/${CMAKE_SYSTEM_PROCESSOR}/support/grub.cfg.in" + ) + + add_custom_command(TARGET "${TARGET}" + POST_BUILD + COMMAND "${GRUB_MKRESCUE_EXE}" + "-o" + "$/${TARGET}.iso" + "$/isofs" + "$" + "2>/dev/null" + BYPRODUCTS "${PROJECT_BINARY_DIR}/$/${TARGET}.iso" + COMMENT "Creating bootable ISO image" + ) +endfunction() -- cgit v1.2.3