mirror of
https://github.com/clementine-player/Clementine
synced 2024-12-22 15:58:45 +01:00
e7364263b2
Compatibility with versions prior to 2.8.12 is being deprecated, resulting in build warning messages. The minimum for the official supported distros is 3.7.2 (Stretch), so the version could be moved forward when newer features are required. Reference: https://cmake.org/cmake/help/v3.19/release/3.19.html#deprecated-and-removed-features
35 lines
1.1 KiB
CMake
35 lines
1.1 KiB
CMake
# From http://www.cmake.org/Wiki/CMakeMacroParseArguments
|
|
|
|
cmake_minimum_required(VERSION 3.0.0)
|
|
|
|
MACRO(PARSE_ARGUMENTS prefix arg_names option_names)
|
|
SET(DEFAULT_ARGS)
|
|
FOREACH(arg_name ${arg_names})
|
|
SET(${prefix}_${arg_name})
|
|
ENDFOREACH(arg_name)
|
|
FOREACH(option ${option_names})
|
|
SET(${prefix}_${option} FALSE)
|
|
ENDFOREACH(option)
|
|
|
|
SET(current_arg_name DEFAULT_ARGS)
|
|
SET(current_arg_list)
|
|
FOREACH(arg ${ARGN})
|
|
SET(larg_names ${arg_names})
|
|
LIST(FIND larg_names "${arg}" is_arg_name)
|
|
IF (is_arg_name GREATER -1)
|
|
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
|
SET(current_arg_name ${arg})
|
|
SET(current_arg_list)
|
|
ELSE (is_arg_name GREATER -1)
|
|
SET(loption_names ${option_names})
|
|
LIST(FIND loption_names "${arg}" is_option)
|
|
IF (is_option GREATER -1)
|
|
SET(${prefix}_${arg} TRUE)
|
|
ELSE (is_option GREATER -1)
|
|
SET(current_arg_list ${current_arg_list} ${arg})
|
|
ENDIF (is_option GREATER -1)
|
|
ENDIF (is_arg_name GREATER -1)
|
|
ENDFOREACH(arg)
|
|
SET(${prefix}_${current_arg_name} ${current_arg_list})
|
|
ENDMACRO(PARSE_ARGUMENTS)
|