Skip to content

Commit 4a66c18

Browse files
CopilotJohnAmadis
andcommitted
Add relative-to-absolute path conversion for DMBOOT_MANIFEST_URL
Co-authored-by: JohnAmadis <17320783+JohnAmadis@users.noreply.github.com>
1 parent 6efa11f commit 4a66c18

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,14 @@ set(DMBOOT_EXTRA_SDCARD_DMD_FILES "" CACHE STRING "Additional sdcard.dmd files t
1717
set(DMBOOT_MANIFEST_URL "" CACHE STRING "Manifest path/URL to use with dmf-get -m flag for all module downloads")
1818
option(DMBOOT_EMULATION "Enable Renode emulation mode" OFF)
1919

20+
# Convert relative manifest path to absolute so it remains valid when the
21+
# working directory changes during the build (e.g. dmf-get is invoked from a
22+
# different directory than where cmake was originally run).
23+
if(DMBOOT_MANIFEST_URL AND NOT DMBOOT_MANIFEST_URL MATCHES "^https?://")
24+
get_filename_component(DMBOOT_MANIFEST_URL "${DMBOOT_MANIFEST_URL}" ABSOLUTE BASE_DIR "${CMAKE_BINARY_DIR}")
25+
message(STATUS "Resolved manifest path to absolute: ${DMBOOT_MANIFEST_URL}")
26+
endif()
27+
2028
# ======================================================================
2129
# Early DMOD Configuration (before project())
2230
# ======================================================================

0 commit comments

Comments
 (0)