[CMake] file not generated with ADD_CUSTOM_COMMAND

Alexander Neundorf a.neundorf-work at gmx.net
Wed Jan 4 16:03:05 EST 2006


> Von: "William A. Hoffman" <billlist at nycap.rr.com> 
... 
> 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. 
 
Indeed. 
And the space between the ">" and the "generated" was deadly, it 
generated a " generated.h"... 
 
Alex 
 

-- 
DSL-Aktion wegen großer Nachfrage bis 28.2.2006 verlängert:
GMX DSL-Flatrate 1 Jahr kostenlos* http://www.gmx.net/de/go/dsl


More information about the CMake mailing list