I am working on CMake unit test cases that is using ctest
.
I am having one question here.
Some part of my CMake is as below:
set(size_w 32 )
set(powerof2_w 5 )
foreach(size ${size_w})
foreach(pwr_of_2 ${powerof2_w})
...
FUNCTION_EXE(${size} ${pwr_of_2})
endforeach(pwr_of_2)
endforeach(size)
set(size_w 64 )
set(powerof2_w 6 )
foreach(size ${size_w})
foreach(pwr_of_2 ${powerof2_w})
...
FUNCTION_EXE(${size} ${pwr_of_2})
endforeach(pwr_of_2)
endforeach(size)
set(size_w 128 )
set(powerof2_w 7 )
foreach(size ${size_w})
foreach(pwr_of_2 ${powerof2_w})
...
FUNCTION_EXE(${size} ${pwr_of_2})
endforeach(pwr_of_2)
endforeach(size)
set(size_w 256 )
set(powerof2_w 8 )
foreach(size ${size_w})
foreach(pwr_of_2 ${powerof2_w})
...
FUNCTION_EXE(${size} ${pwr_of_2})
endforeach(pwr_of_2)
endforeach(size)
Expectation:
I want to reduce that one loop which is with powerof2_w
parameter:
foreach(pwr_of_2 ${powerof2_w})
Is it possible to calculate the pwr_of_2
parameter from the size_w
parameter inside the foreach(size ${size_w})
for-loop itself?
Note: Also, I want to combine all four of these for-loops into one for-loop using an array index.
Is this possible in CMake?