summaryrefslogtreecommitdiff
path: root/infra/nncc/cmake/modules/ListFile.cmake
blob: aee0d162aa49ca46c511a9d2bd5bd29cf6c0ae5b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# Read a file and create a list variable
#
# HOW TO USE
#
#  ListFile_Read("A.txt" A_LIST)
#
function(ListFile_Read FILENAME VARNAME)
  file(READ ${FILENAME} content)
  # Reference: http://public.kitware.com/pipermail/cmake/2007-May/014236.html
  STRING(REGEX REPLACE "\n" ";" content "${content}")
  set(${VARNAME} ${content} PARENT_SCOPE)
endfunction(ListFile_Read)