Skip to content

Commit

Permalink
CMake: create cpio archive in app folder
Browse files Browse the repository at this point in the history
Do not pollute the root folder.

Signed-off-by: Axel Heider <[email protected]>
  • Loading branch information
Axel Heider committed Mar 28, 2023
1 parent ce598e4 commit 50428d0
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions camkes_vm_helpers.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,21 @@ function(DefineCAmkESVMFileServer)
get_target_property(fileserver_images vm_fserver_config FILES)
get_target_property(fileserver_deps vm_fserver_config DEPS)
# Build CPIO archive given the defined kernel and rootfs images
set(CPIO_ARCHIVE "${CMAKE_CURRENT_BINARY_DIR}/file_server_archive.o")
include(cpio)
MakeCPIO(file_server_archive.o "${fileserver_images}" DEPENDS "${fileserver_deps}")
add_library(fileserver_cpio STATIC EXCLUDE_FROM_ALL file_server_archive.o)
set_property(TARGET fileserver_cpio PROPERTY LINKER_LANGUAGE C)
ExtendCAmkESComponentInstance(FileServer fserv LIBS fileserver_cpio)
MakeCPIO("${CPIO_ARCHIVE}" "${fileserver_images}" DEPENDS "${fileserver_deps}")
# Build a library from the CPIO archive
set(FILESERVER_LIB "fileserver_cpio")
add_library(${FILESERVER_LIB} STATIC EXCLUDE_FROM_ALL "${CPIO_ARCHIVE}")
set_target_properties(
${FILESERVER_LIB}
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY
"${CMAKE_CURRENT_BINARY_DIR}"
LINKER_LANGUAGE
"C"
)
ExtendCAmkESComponentInstance(FileServer fserv LIBS ${FILESERVER_LIB})
endfunction(DefineCAmkESVMFileServer)

# Function for declaring the CAmkESVM root server. Taking the camkes application
Expand Down

0 comments on commit 50428d0

Please sign in to comment.