<div dir="auto"><div>Thank you for your suggestions.</div><div dir="auto">I think the best option is a patch but it will take some time ... I guess I will have to find a workaround in the meantime !</div><div dir="auto"><br></div><div dir="auto">Anyway, thanks again !</div><div dir="auto">Olivier<br><br><div class="gmail_quote" dir="auto"><div dir="ltr" class="gmail_attr">Le mar. 5 mars 2019 à 18:58, Kyle Edwards <<a href="mailto:kyle.edwards@kitware.com">kyle.edwards@kitware.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Tue, 2019-03-05 at 10:01 -0700, Olivier Gomez wrote:<br>
> Hello,<br>
> <br>
> I have been searching for a way to remove a custom command<br>
> (POST_BUILD<br>
> event) from a target in CMake but, so far, I've found nothing.<br>
> <br>
> I tried to add another custom command to override the first one but<br>
> it seems<br>
> to append a second command. <br>
> I tough that could work because of the first signature of<br>
> add_custom_command() that can take an optional argument named APPEND.<br>
> <a href="https://cmake.org/cmake/help/v3.4/command/add_custom_command.html#gen" rel="noreferrer noreferrer" target="_blank">https://cmake.org/cmake/help/v3.4/command/add_custom_command.html#gen</a><br>
> erating-files<br>
> Then, I looked for a target property that contains the POST_BUILD<br>
> custom<br>
> command (to erase it) but, again, I found nothing related (I listed<br>
> every<br>
> property using the "cmake --help-property-list" command).<br>
> <br>
> <br>
> The context is that I configure a project using a "CMake SDK" from a<br>
> third<br>
> party library (custom functions that create and configure a shared<br>
> library<br>
> target basically).<br>
> Until recently, I used to create those target by myself using<br>
> standard CMake<br>
> command.<br>
> But now I switched to the "SDK" because it does a lot of specific<br>
> thing<br>
> depending on the platform (and between the current version of the SDK<br>
> and<br>
> all the legacy version) and I don't want to rewrite everything.<br>
> <br>
> Specifically, this SDK add a custom command as a POST_BUILD event to<br>
> run a<br>
> tool that perform a signature on the produced library. As it is a<br>
> proprietary tool that requires a valid licence to work, I want to<br>
> remove<br>
> that command in order to have a successful build even if i don't<br>
> currently<br>
> have a licence on my machine.<br>
> <br>
> So ... is there some way to remove a custom command in CMake ? (or<br>
> ignore<br>
> failed command maybe)<br>
<br>
CMake doesn't have a way to remove a custom command from a target. Your<br>
best bet would be to either:<br>
<br>
1) Fork the SDK for your project to remove the proprietary tool, or<br>
2) Submit a patch upstream to add an option to disable the proprietary<br>
tool.<br>
<br>
Kyle<br>
</blockquote></div></div></div>