This repository was archived by the owner on Apr 17, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Expand file tree Collapse file tree 2 files changed +21
-12
lines changed Original file line number Diff line number Diff line change 1111function (parse_sources_arguments _return_var _reserved_options _reserved_single_values
1212 _reserved_multi_values _cmake_args)
1313
14- # Prepare arguments for further inspection - Somewhat croocked logic due to CMake's limitations
15- # If an argument is an empty string, populate it with a theoritcally impossible value.
16- # just to have some value in it
17- if ("${_reserved_options} " STREQUAL "" )
18- set (_reserved_options "+-*/" )
19- endif ()
20- if ("${_reserved_single_values} " STREQUAL "" )
21- set (_reserved_single_values "+-*/" )
22- endif ()
23- if ("${_reserved_multi_values} " STREQUAL "" )
24- set (_reserved_multi_values "+-*/" )
25- endif ()
14+ # Initialize argument-lists for further inspection
15+ initialize_list(_reserved_options)
16+ initialize_list(_reserved_single_values)
17+ initialize_list(_reserved_multi_values)
2618
2719 set (sources "" ) # Clear list because cmake preserves scope in nested functions
2820
Original file line number Diff line number Diff line change 55# Must not be negative or greater than 'list_length'-1.
66#=============================================================================#
77macro (list_replace _list _index _new_element)
8+
89 list (REMOVE_AT ${_list} ${_index} )
10+
911 list (INSERT ${_list} ${_index} "${_new_element} " )
12+
13+ endmacro ()
14+
15+ #=============================================================================#
16+ # Checks whether the given list is empty. If it is - Initializes it with a theoretically
17+ # impossible to reproduce value, so if it's used to check whether an item is in it
18+ # the answer will be false.
19+ # _list - List to initialize.
20+ #=============================================================================#
21+ macro (initialize_list _list)
22+
23+ if ("${${_list} }" STREQUAL "" )
24+ set (${_list} "+-*/" )
25+ endif ()
26+
1027endmacro ()
You can’t perform that action at this time.
0 commit comments