cheshirekow / cmake_format

Source code formatter for cmake listfiles.
GNU General Public License v3.0
962 stars 105 forks source link

genparsers.py not work for my command #296

Open KindDragon opened 2 years ago

KindDragon commented 2 years ago

genparsers.py for this script

function(add_my_library NAME)
    set(top_options NODEFAULTLIBS NODEFAULTPREFIX SHARED)
    set(top_single OUTPUT_DIR OUTPUT_NAME SUFFIX)
    set(top_multi PUB PRIV IFACE PROPS DEPS)
    set(options)
    set(single)
    set(multi SRCS INCS LIBS DEFS)
    cmake_parse_arguments(PARSE_ARGV 1 args "${top_options}" "${top_single}" "${top_multi}")
    cmake_parse_arguments(args_pub "${options}" "${single}" "${multi}" ${args_PUB})
    cmake_parse_arguments(args_pvt "${options}" "${single}" "${multi}" ${args_PRIV})
    cmake_parse_arguments(args_iface "${options}" "${single}" "${multi}" ${args_IFACE})
endfunction()

generate this parser

add_my_library:
  pargs:
    nargs: 1+
    flags:
    - '1'
  kwargs:
    ARGS: 1
    NODEFAULTLIBS: +
    NODEFAULTPREFIX: +
    SHARED: +

I think currently genparsers.py not support this syntax cmake_parse_arguments `cmake_parse_arguments(PARSE_ARGV

)`