<div class="gmail_quote">On Thu, Oct 13, 2011 at 3:47 PM, Michael Hertling <span dir="ltr">&lt;<a href="mailto:mhertling@online.de">mhertling@online.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">You might use an installation component for the concerned headers:</div></div>
<br>
CMAKE_MINIMUM_REQUIRED(VERSION 2.8 FATAL_ERROR)<br>
PROJECT(INSTCOMP C)<br>
SET(CMAKE_VERBOSE_MAKEFILE ON)<br>
SET(F_PREFIX &quot;/dev/shm&quot; CACHE PATH &quot;&quot;)<br>
FILE(WRITE ${CMAKE_BINARY_DIR}/f.h &quot;void f(void);\n&quot;)<br>
INSTALL(FILES ${CMAKE_BINARY_DIR}/f.h<br>
    DESTINATION ${F_PREFIX}/include<br>
    COMPONENT f)<br>
ADD_CUSTOM_TARGET(f_install<br>
    ${CMAKE_COMMAND} -DCOMPONENT=f -P cmake_install.cmake)<br>
FILE(WRITE ${CMAKE_BINARY_DIR}/main.c<br>
&quot;#include &lt;${F_PREFIX}/include/f.h&gt;<br>
int main(void){return 0;}<br>
&quot;)<br>
ADD_EXECUTABLE(main main.c)<br>
ADD_DEPENDENCIES(main f_install)<br>
<br>
The f.h header is selectively installed via the f_install custom<br>
target, and due to the main-on-f_install dependency, it will be<br>
installed before the main target is built.</blockquote><div><br></div><div>Thanks for the info.</div><div><br></div><div>After I posted I found out about file( COPY ) and used that instead. </div></div>