On Mon, Jun 22, 2009 at 4:43 PM, James C. Sutherland <
[email protected]> wrote:
> I am trying to add most files from a directory to a variable. I first
> glob the source files, and then want to remove the unwanted files from
> the resulting string. Here is what I have:
>
> set( empty "" )
>
> file( GLOB f90_src src/*.f90 )
>
> string( REPLACE
> ${PROJECT_SOURCE_DIR}/src/ark_m.f90
> ${empty}
> f90_src
> ${f90_src}
> )
>
> message( STATUS ${f90_src} )
>
> The problem is that the file is not removed as you would expect. The
> message still outputs a string with both files in it...
>
> Is there a better way to achieve this?
Try
list(REMOVE_ITEM <list> <value> [<value> ...])
See http://www.cmake.org/cmake/help/cmake2.6docs.html#command:list
>
> Thanks!
>
> James
> _______________________________________________
> 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
>
--
Adolfo Rodríguez Tsouroukdissian
Robotics engineer
PAL ROBOTICS S.L
http://www.pal-robotics.com
Tel. +34.93.414.53.47
Fax.+34.93.209.11.09
_______________________________________________
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