<div dir="auto"><div dir="auto"></div>A lot of projects that use CMake already have a `./cmake` directory, I would think `./cmake/init.json` would fit nicer as opposed to the hidden directory. I'm not a fan of hidden directories in software projects anyway.<div dir="auto"><br></div><div dir="auto">I would prefer an init file be written as a CMake file instead of JSON. JSON is nice because it plays well with GUIs, but I think using CMake syntax will function better if the file ever needs to be a bit more complicated.<div dir="auto"><br><div class="gmail_quote" dir="auto"><div dir="ltr">On Fri, Nov 9, 2018, 07:14 Brad King <<a href="mailto:brad.king@kitware.com" rel="noreferrer noreferrer" target="_blank">brad.king@kitware.com</a> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 11/09/2018 05:34 AM, Joachim Wuttke wrote:<br>
> include(PreventInSourceBuilds)<br>
> <br>
> to protect users (and myself) from unintentionally running CMake<br>
> in the source directory.<br>
> <br>
> Would you consider adding this little module to the CMake code base?<br>
<br>
If we are going to offer an upstream solution for this I think<br>
it should be done in a way that avoids ever creating any files<br>
(like CMakeCache.txt or CMakeFiles) in the first place. This<br>
could be achieved by looking for a `.cmake/init.json` file<br>
at the top of the source tree with declarative information<br>
about the project's preferences. One of those settings could<br>
reject in-source builds.<br>
<br>
-Brad<br>
-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer noreferrer noreferrer noreferrer" 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" rel="noreferrer noreferrer noreferrer noreferrer" 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" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer noreferrer noreferrer noreferrer" 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" rel="noreferrer noreferrer noreferrer noreferrer" 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-developers" rel="noreferrer noreferrer noreferrer noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake-developers</a><br>
</blockquote></div></div></div></div>