CMakeLists.txt 625 B

12345678910111213141516
  1. # Populate a C array with random data.
  2. set(RAW_PIXELS_SIZE 102400)
  3. set(RAW_PIXELS_HEADER ${CMAKE_CURRENT_BINARY_DIR}/raw_pixels.hpp)
  4. set(RAW_PIXELS_HEADER_IN ${CMAKE_CURRENT_SOURCE_DIR}/raw_pixels.hpp.in)
  5. set(RAW_PIXEL_VALUES "")
  6. # Seed the random number generator.
  7. string(RANDOM LENGTH 8 ALPHABET 0123456789abcdf RANDOM_SEED 314 number)
  8. math(EXPR LOOP_RANGE "${RAW_PIXELS_SIZE} - 1")
  9. foreach(i RANGE ${LOOP_RANGE})
  10. string(RANDOM LENGTH 8 ALPHABET 0123456789abcdf number)
  11. string(CONCAT RAW_PIXEL_VALUES ${RAW_PIXEL_VALUES} "0x${number}, \\\n")
  12. endforeach()
  13. configure_file(${RAW_PIXELS_HEADER_IN} ${RAW_PIXELS_HEADER})