From 8eb6b543d1da3b45f629aa4f0ba796526b437ae9 Mon Sep 17 00:00:00 2001 From: Janusz Jankowski Date: Thu, 3 Sep 2020 16:09:33 +0200 Subject: [PATCH] cmake: add FIRMWARE_NAME option Add CMake argument FIRMWARE_NAME that enables setting custom suffix for output binary. Example `cmake ... -DFIRMWARE_NAME=custom ...` will save output files as sof-custom.ri, sof-custom.ldc etc. Signed-off-by: Janusz Jankowski --- src/arch/xtensa/CMakeLists.txt | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/src/arch/xtensa/CMakeLists.txt b/src/arch/xtensa/CMakeLists.txt index 88fb59a7f..e9dd8cef5 100644 --- a/src/arch/xtensa/CMakeLists.txt +++ b/src/arch/xtensa/CMakeLists.txt @@ -462,13 +462,19 @@ else() add_custom_target(run_meu DEPENDS run_rimage) endif() +if(NOT DEFINED FIRMWARE_NAME) + set(fw_output_name "${fw_name}") +else() + set(fw_output_name "${FIRMWARE_NAME}") +endif() + if(MEU_NO_SIGN) # copy rimage output that can be used to sign firmware add_custom_target( bin ALL - COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri.uns ${PROJECT_BINARY_DIR}/sof-${fw_name}.ri.uns - COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri.met ${PROJECT_BINARY_DIR}/sof-${fw_name}.ri.met - COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ldc ${PROJECT_BINARY_DIR}/sof-${fw_name}.ldc + COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri.uns ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ri.uns + COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri.met ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ri.met + COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ldc ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ldc DEPENDS run_meu bin_extras VERBATIM USES_TERMINAL @@ -476,8 +482,8 @@ if(MEU_NO_SIGN) else() add_custom_target( bin ALL - COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri ${PROJECT_BINARY_DIR}/sof-${fw_name}.ri - COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ldc ${PROJECT_BINARY_DIR}/sof-${fw_name}.ldc + COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ri ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ri + COMMAND ${CMAKE_COMMAND} -E copy sof-${fw_name}.ldc ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ldc DEPENDS run_meu bin_extras VERBATIM USES_TERMINAL @@ -485,7 +491,7 @@ else() endif() install( - FILES ${PROJECT_BINARY_DIR}/sof-${fw_name}.ri - ${PROJECT_BINARY_DIR}/sof-${fw_name}.ldc + FILES ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ri + ${PROJECT_BINARY_DIR}/sof-${fw_output_name}.ldc DESTINATION bin )