sfizz-ui/cmake/StringUtility.cmake
redtide 6953168087
CMake definitions and format rearrangement
- Rename some SFIZZ_ prefixed definitions where possible to permit some modules
  to be generic and be reused in other projects, keep project' information
  in the same place and more explicit
- Fixed non-compliant code formatting
2023-05-20 16:21:00 +02:00

15 lines
589 B
CMake

# SPDX-License-Identifier: BSD-2-Clause
# This code is part of the sfizz library and is licensed under a BSD 2-clause
# license. You should have receive a LICENSE.md file along with the code.
# If not, contact the sfizz maintainers at https://github.com/sfztools/sfizz
function(string_left_pad VAR INPUT LENGTH FILLCHAR)
set(_output "${INPUT}")
string(LENGTH "${_output}" _length)
while(_length LESS "${LENGTH}")
set(_output "${FILLCHAR}${_output}")
string(LENGTH "${_output}" _length)
endwhile()
set("${VAR}" "${_output}" PARENT_SCOPE)
endfunction()