<div class="gmail_quote">On Thu, Oct 13, 2011 at 3:47 PM, Michael Hertling <span dir="ltr"><<a href="mailto:mhertling@online.de">mhertling@online.de</a>></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 "/dev/shm" CACHE PATH "")<br>
FILE(WRITE ${CMAKE_BINARY_DIR}/f.h "void f(void);\n")<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>
"#include <${F_PREFIX}/include/f.h><br>
int main(void){return 0;}<br>
")<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>