zephyr/cmake/util/fmerge.cmake
Anas Nashif 3ae52624ff license: cleanup: add SPDX Apache-2.0 license identifier
Update the files which contain no license information with the
'Apache-2.0' SPDX license identifier.  Many source files in the tree are
missing licensing information, which makes it harder for compliance
tools to determine the correct license.

By default all files without license information are under the default
license of Zephyr, which is Apache version 2.

Signed-off-by: Anas Nashif <anas.nashif@intel.com>
2019-04-07 08:45:22 -04:00

20 lines
524 B
CMake

# SPDX-License-Identifier: Apache-2.0
# Merges a list of files into a destination file.
# Usage: list of files as arguments, first argument is the destination file
MATH(EXPR ARGC "${CMAKE_ARGC}-1")
# First 3 arguments are "cmake", "-P", and "process.cmake"
if( ${CMAKE_ARGC} LESS 5)
message(FATAL_ERROR "Not enough arguments")
endif()
set(DEST_FILE ${CMAKE_ARGV3})
# Empty the file
file(REMOVE ${DEST_FILE})
foreach(i RANGE 4 ${ARGC})
file(READ ${CMAKE_ARGV${i}} BUF)
file(APPEND ${DEST_FILE} ${BUF})
endforeach()