[CMake] Installing results of ADD_CUSTOM_COMMAND
Brad King
brad.king at kitware.com
Tue Nov 9 07:00:30 EST 2004
Hi Alex,
>I have a bit of a problem using cmake for IDL files.
>I used ADD_CUSTOM_COMMAND to generate .h/.cpp files from .idl files:
[snip]
>I tell cmake to install the header files with:
>
>FOREACH ( FILE ${IDL_HEADER_FILES} )
> INSTALL_FILES( /include/orca ${FILE} )
>ENDFOREACH ( FILE ${IDL_HEADER_FILES} )
>
>The problem is that cmake can't find the IDL_HEADER_FILES when it is run
>(because they're only generated from .idl later, when 'make' is run).
Make sure that IDL_HEADER_FILES contains the list of files with full
paths constructed from something like ${CMAKE_CURRENT_BINARY_DIR}/foo.h
for each file. Then just use this command to install it:
INSTALL_FILES(/include/orca FILES ${IDL_HEADER_FILES})
The "FILES" option tells the command to trust you and install the
specific list of files you give it. See the documentation dumped by
cmake --help-command INSTALL_FILES
for details.
-Brad
More information about the CMake
mailing list