12 lines
360 B
CMake
12 lines
360 B
CMake
|
|
# SPDX-License-Identifier: BSD-2-Clause
|
||
|
|
|
||
|
|
function(string_left_pad VAR INPUT LENGTH FILLCHAR)
|
||
|
|
set(_output "${INPUT}")
|
||
|
|
string(LENGTH "${_output}" _length)
|
||
|
|
while(_length LESS "${LENGTH}")
|
||
|
|
string(PREPEND _output "${FILLCHAR}")
|
||
|
|
string(LENGTH "${_output}" _length)
|
||
|
|
endwhile()
|
||
|
|
set("${VAR}" "${_output}" PARENT_SCOPE)
|
||
|
|
endfunction()
|