title: Passing arrays to a function
body: <p>I want to create a CMake function that takes as first argument a list, and a second argument with a single name.</p>
  
  <pre><code>function (my_function PROJECT_SRC DEPENDENCY_LIB)
    message (STATUS "Dependency lib is ${DEPENDENCY_LIB}")
  endfunction()
  </code></pre>
  
  <p>When I use it, it's not what I expect. If I prepend a list with some source file, the function prints the second argument of the list.</p>
  
  <pre><code>file (GLOB TEST_SRC *.cpp)
  set (MY_DEPENDENCY "Something")
  # It prints "Dependency lib is something/inside/TEST_SRC"
  my_function(${TEST_SRC} ${MY_DEPENDENCY})
  </code></pre>
  
  <p>How can I retrieve the second argument that I pass to the function? Is there a way to distinguish between lists and single values when passing variables to a CMake function?</p>