1. If there is a restriction / condition regarding the "out-of-date" behavior, it might be good to update the documentation.<br><br>2. Yes you are right, I got confused at some point :-\ It is fixed. But still, it is compiling twice during "make" and "make install" (it should not compile during the latest command)<br>
<br>3. I am not 100% sure also... Anyone to give us an advice on that matter??<br><br>Cheers,<br><br>Romain Chanu<br><br><div class="gmail_quote">2009/11/2 Tyler Roscoe <span dir="ltr"><<a href="mailto:tyler@cryptio.net">tyler@cryptio.net</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Mon, Nov 02, 2009 at 10:48:49PM +0800, Romain CHANU wrote:<br>
> # Add a custom target to manage dependencies<br>
> add_custom_target(cxx_xml_mapping DEPENDS xml_mapping)<br>
><br>
> add_custom_command(<br>
> OUTPUT cxx_xml_mapping<br>
> COMMAND ${XSD_EXECUTABLE} ARGS ${XSD_ARGS}<br>
> ${CMAKE_CURRENT_SOURCE_DIR}/*.xsd<br>
> DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/*.xsd<br>
> COMMENT "Generating C++ / XML mapping files")<br>
<br>
</div>Not sure if this is your problem but:<br>
<br>
1. I don't think that verbiage in the docs about custom commands<br>
*always* being out-of-date applies to makefile generators. I've only<br>
seen that behavior in Visual Studio.<br>
<br>
2. Your custom_command needs to have an OUTPUT that corresponds to the<br>
DEPENDS of your custom_target. Here you have two different names,<br>
xml_mapping and cxx_xml_mapping.<br>
<br>
3. I'm not sure your custom_command can DEPEND on *.xsd. How is CMake<br>
supposed to know whether *.xsd refers to 4 files or 40 files, and thus<br>
how can it know when that set of files is up-to-date or not?<br>
<br>
hth,<br>
<font color="#888888">tyler<br>
</font></blockquote></div><br>