[CMake] the list parameter passed to function

Marmot Ken realwangbo at gmail.com
Sun May 27 09:23:16 EDT 2012


Sorry.  Copy-paste error kicks my ass.

 Output expected :

  SRC_LIST : ./a.cpp;./c.cpp;./main.cpp
  src_list_in : ./a.cpp;./c.cpp;./main.cpp

Now i got the solution.

invoke the function like this :

  AUX_SOURCE_DIRECTORY( . SRC_LIST  )
  MESSAGE( SRC_LIST  " : ${SRC_LIST} " )

  Append_headers_to_src_list( SRC_LIST  "${SRC_LIST}"
${CMAKE_SOURCE_DIR}/include/test  )

Question is :
   Why?

2012/5/22 Petr Kmoch <petr.kmoch at gmail.com>

> Hi,
>
> try as I might, I can't see a difference between the output and
> expected output. Perhaps a copy-paste error?
>
> Petr
>
> On Tue, May 22, 2012 at 3:07 AM, Marmot Ken <realwangbo at gmail.com> wrote:
> > here is the function :
> >
> > FUNCTION( Append_headers_to_src_list  src_list_out src_list_in
> > header_file_path_in )
> >     MESSAGE( src_list_in  " : ${src_list_in}" )
> >     FILE( GLOB_RECURSE TEMP_LIST ${header_file_path_in}/*.h )
> >     SET( ${src_list_out} ${src_list_in} ${TEMP_LIST} PARENT_SCOPE )
> > ENDFUNCTION( Append_headers_to_src_list
> >
> >
> > here is the place where the function is invoked:
> >
> > AUX_SOURCE_DIRECTORY( . SRC_LIST  )
> > MESSAGE( SRC_LIST  " : ${SRC_LIST} " )
> >
> > Append_headers_to_src_list( SRC_LIST  ${SRC_LIST}
> > ${CMAKE_SOURCE_DIR}/include/test  )
> >
> > here is output :
> >
> > SRC_LIST : ./a.cpp;./c.cpp;./main.cpp
> > src_list_in : ./a.cpp
> >
> > Output expected :
> >
> > SRC_LIST : ./a.cpp;./c.cpp;./main.cpp
> > src_list_in : ./a.cpp
> >
> > Question:
> >       <1>  how to get expected Output ?
> >         <2>  why ?
> >
> > Thanks.
> >
> > --
> >
> > Powered by www.kitware.com
> >
> > Visit other Kitware open-source projects at
> > http://www.kitware.com/opensource/opensource.html
> >
> > Please keep messages on-topic and check the CMake FAQ at:
> > http://www.cmake.org/Wiki/CMake_FAQ
> >
> > Follow this link to subscribe/unsubscribe:
> > http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20120527/385bd722/attachment.htm>


More information about the CMake mailing list