[CMake] custom commands and dependenciy problems

Brad King brad.king at kitware.com
Fri Jun 17 10:19:06 EDT 2005


Bradley Lowekamp wrote:
> I have code similar to this and I don't under stand why it is not working:
> 
> 
> ADD_CUSTOM_TARGET(gen DEPENDS ${SOME_GENERATED_FILES})
> 
> SET_SOURCE_FILES_PROPERTIES(${SOME_SRC_FILES} PROPERTIES OBJECT_DEPENDS 
> gen)
> 
> ADD_LIBRARY(my ${SOME_SRC_FILES})
> 
> 
> I am using make files on linux, a recent CVS version (last week). There 
> make error message I am getting is "No rule to make target 'gen', needed 
> by 'mysrc.cpp'. Stop. " Am I not under standing something or have I 
> encountered a bug or something?

Use GET_TARGET_PROPERTY as shown here:

http://public.kitware.com/Wiki/CMake_FAQ#How_can_I_generate_a_source_file_during_the_build.3F

to get the proper name for the dependency.

-Brad



More information about the CMake mailing list