<div dir='auto'>Hello,<div dir="auto"><br></div><div dir="auto">I'm working on a project where some of our libs depend on custom build of some external libraries.</div><div dir="auto">Those external libraries are managed through a repository manager similar to rpm (redhat package manager) which allows us to retrieve pre-compiled versions with related header files. (similar to devel packages)</div><div dir="auto"><br></div><div dir="auto">The catch is we want libraries to be downloaded automatically to a shared (multiple users) local dir __AND__ we don't want them to be cleaned. (because another user could be using it).</div><div dir="auto"><br></div><div dir="auto">I've tried add_custom_command but files disappear with make clean.</div><div dir="auto">I've tried to set NO_CUSTOM_CLEAN, that works with make but not with ninja.</div><div dir="auto"><br></div><div dir="auto">I've tried to chain add_custom_target to download the file and add_dependencies, again, this works with make but not with ninja (ninja does not know how to create protocol buffer compiler "protoc" for example since it's not the output of any command he knows)</div><div dir="auto"><br></div><div dir="auto">I've tried externalproject_add with BUILD_BYPRODUCTS but it looks like ninja still clean the downloaded files.</div><div dir="auto"><br></div><div dir="auto">Any idea on how to make ninja not clean those downloaded files (we use generators like protoc, libraries and header files)</div><div dir="auto"><br></div><div dir="auto">With regards</div><div dir="auto"><br></div><div dir="auto">David</div><div dir="auto"><br></div><div dir="auto">PS : in my add_custom_command/add_custom_target, I invoke "cmake -P" on a custom cmake script with 2 args. The first arg is a file to test for existence, the second one is the parameter to our custom "rpm" to download the package.</div></div>