Re: [CMake] Copy files to build folder

2012-01-17 Thread Tim Hutton
For the recommended approach of including an explicit list of pattern files, is this the right way to do it? ... set(PATTERN_FILES# (found in the "patterns" folder) example1.vti example2.vti subfolder1/example3.vti ) ... #--copy pattern files to build folder---

Re: [CMake] Copy files to build folder

2012-01-17 Thread Michael Wild
On 01/17/2012 03:25 PM, Tim Hutton wrote: > On 17 January 2012 13:21, David Cole wrote: >> If you want to use file GLOB at CMake time, then you have to re-run >> CMake manually when you add or remove a file. There's no way around >> that, because we are not going to monitor your hard drive for >>

Re: [CMake] Copy files to build folder

2012-01-17 Thread Tim Hutton
On 17 January 2012 13:21, David Cole wrote: > If you want to use file GLOB at CMake time, then you have to re-run > CMake manually when you add or remove a file. There's no way around > that, because we are not going to monitor your hard drive for > arbitrary file changes on a continuous basis...

Re: [CMake] Copy files to build folder

2012-01-17 Thread Rolf Eike Beer
> Thanks Andreas, but that leaves us with having to edit the > CMakeLists.txt every time we add a pattern file. There must be a > better way? How should CMake find out that it needs to update it's file list then? Citing from the FILE(GLOB) documentation: (We do not recommend using GLOB to collec

Re: [CMake] Copy files to build folder

2012-01-17 Thread David Cole
You could instead have a custom command that operates against a file that contains an explicit list of the pattern files, and then just edit that file when you add or remove a pattern. Then your custom command would depend on that file, and it would re-run when that file changes, and there's no nee

Re: [CMake] Copy files to build folder

2012-01-17 Thread Michael Wild
AFAICS these files are considered to be source files, right? So they should be explicitly listed in the CMakeLists.txt file. If your CMakeLists.txt file gets too big, you can put the relevant code into another file and then include() it from the CMakeLists.txt. Doing this also helps you detecting

Re: [CMake] Copy files to build folder

2012-01-17 Thread Tim Hutton
Thanks Andreas, but that leaves us with having to edit the CMakeLists.txt every time we add a pattern file. There must be a better way? On 17 January 2012 13:02, Andreas Pakulat wrote: > On 17.01.12 12:54:28, Tim Hutton wrote: >> We've got this section in our CMakeLists.txt: >> >> #--

Re: [CMake] Copy files to build folder

2012-01-17 Thread Andreas Pakulat
On 17.01.12 12:54:28, Tim Hutton wrote: > We've got this section in our CMakeLists.txt: > > #--copy pattern files to build > folder- > > file( GLOB_RECURSE pattern_files RELATIVE > "${CMAKE_CURRENT_SOURCE_DIR}/" "patterns/*.vti" ) > foreach(

[CMake] Copy files to build folder

2012-01-17 Thread Tim Hutton
We've got this section in our CMakeLists.txt: #--copy pattern files to build folder- file( GLOB_RECURSE pattern_files RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}/" "patterns/*.vti" ) foreach( pattern_file ${pattern_files} ) add_custom_command(