<div dir="ltr"><div>That could work too but as the SDK is a single cmake file that rely on nothing else, I can make a copy of it in my repo, remove the add_custom_command() call and use that local version until the patch is done.<br></div><div>It won't force me to change the environment on every computer.</div><div><br></div><div>But I'll keep that idea for other cases ! Thanks.</div><div><br></div><div>Olivier</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mer. 6 mars 2019 à 08:38, Marc CHEVRIER <<a href="mailto:marc.chevrier@gmail.com">marc.chevrier@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div name="messageBodySection">In the meantime if this POST_BUILD command calls a specific tool you can create a no-op shell script with the same name and put its location in the PATH variable.</div>
<div name="messageReplySection">Le 6 mars 2019 à 07:41 +0100, Olivier Gomez <<a href="mailto:oliviergomez.og@gmail.com" target="_blank">oliviergomez.og@gmail.com</a>>, a écrit :<br>
<blockquote type="cite" style="margin:5px;padding-left:10px;border-left:thin solid rgb(26,188,156)">
<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" target="_blank">kyle.edwards@kitware.com</a>> a écrit :<br></div>
<blockquote class="gmail_quote" style="margin:5px;padding-left:10px;border-left:thin solid rgb(230,126,34)">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>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" target="_blank">http://cmake.org/cmake/help/training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br></blockquote>
</div>
</div>
</blockquote></div>