[Cmake] Looping over numbers

John Biddiscombe john.biddiscombe at mirada-solutions.com
Tue Feb 4 11:43:49 EST 2003


Hi again,

Is there an easier way to loop over numbers than this

  FOREACH (testnumber 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
20)
    ADD_TEST( 
      # name of the test as seen on the dashboard	
      TestPetBodySegmentation${testnumber}
        # the executable to run 
        ${EXECUTABLE_OUTPUT_PATH}/TestPetBodySegmentation.exe 
          # args
          "Test Case ${testnumber}/test_case_${testnumber}" 
          "Test Case ${testnumber}/test_case_${testnumber}_info.txt"
          "Test Case ${testnumber}/test_case_${testnumber}_baseline"
    )
  ENDFOREACH (testnumber) 

It works fine, but is there a

  FOREACH (testnumber {1..20} )

Type syntax I can use? If not shall I have a go at adding one?

JB



More information about the CMake mailing list