[CMake] Using ADD_CUSTOM_COMMAND to generate sources...

Matthew Woehlke mw_triad at users.sourceforge.net
Tue May 15 11:45:42 EDT 2007


Ok... so I see that ADD_CUSTOM_COMMAND is silently ignored if no targets 
depend on the OUTPUT. What is strange is that the output is #include'd 
from one of my source files, and I can see from looking at the generated 
CMakeFiles/mytarget.dir/CXX.includecache that cmake /does/ know about 
the dependency. So why do I still have to explicitly tell CMake about 
the dependency? (This occurs even if the file is output to the source 
directory, i.e. the full path matches what is in the CXX.includecache.)

Also, what is the correct way to set up the dependency? I am using:

set_source_files_properties(main.cpp PROPERTIES OBJECT_DEPENDS 
${objects_def})

...but I seem to recall someone saying that this is deprecated?

-- 
Matthew
People say I'm going insane. I say, "what do you mean, 'going'?".



More information about the CMake mailing list