function(AllCombinations list_in)
list(LENGTH list_in list_count)
set(num_combos 1)
- math(EXPR num_combos "${num_combos} << ${list_count}")
+ # subtract 1 since we will iterate from 0 to num_combos
+ math(EXPR num_combos "(${num_combos} << ${list_count}) - 1")
set(LIST_OUT "")
- foreach (c RANGE ${num_combos})
+ foreach (c RANGE 0 ${num_combos})
set(current_combo "")
# this is a little ridiculous just to iterate through a list w/ indices
math(EXPR last_list_index "${list_count} - 1")
endforeach ()
list(APPEND LIST_OUT ${current_combo})
endforeach ()
+ list(APPEND LIST_OUT " ") # Empty set is a valic combination, but CMake isn't appending the empty string for some reason, use a space
set(LIST_OUT ${LIST_OUT} PARENT_SCOPE)
endfunction ()
endforeach ()
# parse file name
- string(REGEX MATCH "[a-z]+_[LR]" source_name ${source_file})
+ string(REGEX MATCH "^[a-zA-Z_]+" source_name ${source_file})
string(TOUPPER ${source_name} source_name)
# prepend the uppercased file name to the obj name
# now add the object and set the defines
add_library(${obj_name} OBJECT ${source_file})
- set_target_properties(${obj_name} PROPERTIES COMPILE_DEFINITIONS "${def_combo}")
+ if (NOT "${def_combo}" STREQUAL " ") # using space as the empty set
+ set_target_properties(${obj_name} PROPERTIES COMPILE_DEFINITIONS "${def_combo}")
+ endif ()
endforeach ()
endforeach ()
endfunction ()
set(TRM_DEFINES TRANS UPPER UNIT)
GenerateObjects("${TRM_SOURCES}" "${TRM_DEFINES}")
+# TODO: also need to set NN for all these objs (add param to GenerateObjects for defines that apply to all
+GenerateObjects("symm_k.c" "LOWER;RSIDE")
+
# dsymm_LU.c dsymm_LL.c dsymm_RU.c dsymm_RL.c
# dsyrk_UN.c dsyrk_UT.c dsyrk_LN.c dsyrk_LT.c
# dsyr2k_UN.c dsyr2k_UT.c dsyr2k_LN.c dsyr2k_LT.c