[Cmake] generating source

Doug Henry doug_henry at xontech . com
Wed, 17 Dec 2003 14:05:46 -0500


thanks!!  that seems to work.  Just so I understand, the only difference
seems to be that the full path is specified right?

On Wed, 2003-12-17 at 13:58, Andy Cedilnik wrote:
> Hi Doug,
> 
> Try:
> 
> 
> ADD_CUSTOM_TARGET(
> 		OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/types.cpp
> 		DEPENDS gencode
> 		COMMAND ${EXE_DIR}/gencode
> 		ARGS test
> 	)
> ADD_LIBRARY(common ${CMAKE_CURRENT_BINARY_DIR}/types.cpp)
> 
> 			Andy
> 
> On Wed, 2003-12-17 at 13:47, Doug Henry wrote:
> > the mastering cmake book states that you can generate source files by
> > doing this (e.g. gencode creates types.cpp and types.h):
> > 
> > 	ADD_EXECUTABLE(gencode gencode.cpp)
> > 	TARGET_LINK_LIBRARIES(gencode somelibs)
> > 
> > 	ADD_CUSTOM_TARGET(
> > 		OUTPUT types.cpp
> > 		DEPENDS gencode
> > 		COMMAND ${EXE_DIR}/gencode
> > 		ARGS test
> > 	)
> > 
> > 	ADD_LIBRARY(common types.cpp)
> > 
> > but when I run cmake it gives me this error message:
> > 
> > 	CMake Error: can not find file /local/workspace/dswng/gencode/types.cpp
> >  
> > 	Tried .c .C .c++ .cc .cpp .cxx .m .M .mm .h .h++ .hm .hpp .hxx .in .txx
> > 
> > What am I missing?
> > 
> > Thanks
> > 
> > _______________________________________________
> > Cmake mailing list
> > Cmake at www . cmake . org
> > http://www . cmake . org/mailman/listinfo/cmake
> 
> _______________________________________________
> Cmake mailing list
> Cmake at www . cmake . org
> http://www . cmake . org/mailman/listinfo/cmake