title: Passing a list to a CMake macro
body: <p>I am trying to write a macro which goes through a given list of libraries. However the message call in the macro prints only the first item of the list. What am I doing wrong here?</p>
  
  <p>Code:</p>
  
  <pre><code>    macro( FindLibs LIBRARY_NAMES_LIST )
          message( "inside ${LIBRARY_NAMES_LIST}" )
      endmacro()
  
      set( LIBRARY_NAMES_LIST lib1 lib2 lib3)
      message( "outside ${LIBRARY_NAMES_LIST}" )
      FindLibs(${LIBRARY_NAMES_LIST})
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>message( "outside lib1 lib2 lib3" )
  message( "inside lib1" )
  </code></pre>