[CMake] file not generated with ADD_CUSTOM_COMMAND

William A. Hoffman billlist at nycap.rr.com
Wed Jan 4 15:07:05 EST 2006


At 01:54 PM 1/4/2006, Alexander Neundorf wrote:
>> Von: "William A. Hoffman" <billlist at nycap.rr.com> 
>... 
>> Actually, I think Brad fixed this: 
>>  
>> revision 1.71 
>> date: 2005-08-17 15:43:58 +0000;  author: king;  state: Exp;  lines: 
>+64 
>> -7 
>> ENH: Adding support for automatically adding the OBJECT_DEPENDS for 
>> generated header files. 
>>  
>> It may only be in CVS cmake.  Are you using CVS?  It may be broken... 
> 
>But to which file should the OBJECT_DEPENDS be added ? In the QT4_WRAP_UI 
>it's not know at this moment. 
> 
>Yes, current cvs. 
> 

I got it to work with this:

ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/generated.h COMMAND 
sh ARGS -c "echo // >generated.h" ) 
INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_BINARY_DIR})
ADD_EXECUTABLE(hello main.cpp) 
 
You were missing the INCLUDE_DIRECTORIES command so the depend information
did not search the correct directory for the file.

-Bill 



More information about the CMake mailing list