Actually, never mind. bar.h was a new header file, wasn't it?<div><br></div><div>The difference then is that install(DIRECTORY always scans the entire directory structure and copies new stuff in when it appears. Seems odd to add a header file and then not have to build anything before doing another make install... but I guess there might be a real world use case for this?</div>
<div><br></div><div>...but looks like you are right. I retract my statement that cmake does nothing when you add a header file and use install(DIRECTORY. It copies the new file, as you might reasonably expect.<br><br></div>
<div>And file(GLOB at cmake configure time is not recommended for building or installing files.</div><div><br></div><div><br></div><div>Sorry for the noise.</div><div><br></div><div><br><div class="gmail_quote">On Wed, Oct 28, 2009 at 2:32 PM, David Cole <span dir="ltr"><<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">You are touching an existing header file...<div><br></div><div>What happens if you add a new header file that was not there the first time you ran make install?</div>
<div><div></div><div class="h5"><div><br><br><div class="gmail_quote">On Wed, Oct 28, 2009 at 2:26 PM, Tyler Roscoe <span dir="ltr"><<a href="mailto:tyler@cryptio.net" target="_blank">tyler@cryptio.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div>On Wed, Oct 28, 2009 at 01:18:55PM -0400, David Cole wrote:<br>
> Except: that argument is not valid in this case. Neither file(GLOB nor<br>
> install(DIRECTORY will "rerun" anything if a new header file is added into<br>
> the directory...<br>
<br>
</div>David I don't think this is correct.<br>
<br>
Here's a test using file(GLOB) + install(FILES):<br>
<br>
[tylermr@alta:~/install-dir-vs-file-glob-test/b]$ cat ../CMakeLists.txt<br>
cmake_minimum_required(VERSION 2.6)<br>
project (test)<br>
<br>
set (CMAKE_INSTALL_PREFIX "/tmp/install.test.tmr")<br>
<br>
file (GLOB header_files "include/*.h")<br>
install (FILES ${header_files} DESTINATION include)<br>
<br>
[tylermr@alta:~/install-dir-vs-file-glob-test/b]$ cmake ..<br>
-- Configuring done<br>
-- Generating done<br>
-- Build files have been written to:<br>
/alta/tylermr/install-dir-vs-file-glob-test/b<br>
<br>
[tylermr@alta:~/install-dir-vs-file-glob-test/b]$ make install<br>
Install the project...<br>
-- Install configuration: ""<br>
-- Installing: /tmp/install.test.tmr/include/foo.h<br>
<br>
[tylermr@alta:~/install-dir-vs-file-glob-test/b]$ touch ../include/bar.h<br>
<br>
[tylermr@alta:~/install-dir-vs-file-glob-test/b]$ make install<br>
Install the project...<br>
-- Install configuration: ""<br>
-- Up-to-date: /tmp/install.test.tmr/include/foo.h<br>
<br>
<br>
Note that CMake does not notice the addition of bar.h.<br>
<br>
<br>
Here's a test using install(DIRECTORY):<br>
<br>
[tylermr@alta:~/install-dir-vs-file-glob-test/b]$ cat ../CMakeLists.txt<br>
cmake_minimum_required(VERSION 2.6)<br>
project (test)<br>
<br>
set (CMAKE_INSTALL_PREFIX "/tmp/install.test.tmr")<br>
<br>
install (DIRECTORY include DESTINATION include)<br>
<br>
[tylermr@alta:~/install-dir-vs-file-glob-test/b]$ make install<br>
Install the project...<br>
-- Install configuration: ""<br>
-- Installing: /tmp/install.test.tmr/include/include<br>
-- Installing: /tmp/install.test.tmr/include/include/foo.h<br>
<br>
[tylermr@alta:~/install-dir-vs-file-glob-test/b]$ touch ../include/bar.h<br>
<br>
[tylermr@alta:~/install-dir-vs-file-glob-test/b]$ make install<br>
Install the project...<br>
-- Install configuration: ""<br>
-- Installing: /tmp/install.test.tmr/include/include<br>
-- Up-to-date: /tmp/install.test.tmr/include/include/foo.h<br>
-- Installing: /tmp/install.test.tmr/include/include/bar.h<br>
<br>
<br>
Note that bar.h is noticed and installed.<br>
<font color="#888888"><br>
<br>
tyler<br>
</font></blockquote></div><br></div>
</div></div></blockquote></div><br></div>