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---
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
>>
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...
> 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
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
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
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:
>>
>> #--
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(
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(