<div dir="ltr"><br><div class="gmail_quote"><br><div dir="ltr"><div>Hi,<br><br></div>here is my 5 cents...<br><div><div><div class="gmail_extra"><br><div class="gmail_quote"><span class="">On Tue, Apr 11, 2017 at 10:52 PM, Brad King <span dir="ltr"><<a href="mailto:brad.king@kitware.com" target="_blank">brad.king@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 04/11/2017 11:41 AM, Petr Kmoch wrote:<br>
> Currently, adding a new source file to a CMake-controlled project<br>
> means doing two things: creating the file on disk, and adding it<br>
> to the relevant CMakeList add_library() or add_executable() call.<br>
<br>
</span>I view this as a matching pair with an implicit sanity check.<br></blockquote></span><div>+1 <br></div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
> switch from current behaviour of "error out if source file is not found"<br>
> to "create empty source file if it's not found."<br>
<br>
</span>So a typo in the `CMakeLists.txt` file leads to silent creation of a<br>
source file instead of an error message?<br></blockquote></span><div>+1 <br></div><div><br>doesn't looks like a good idea... also if someone (re)moved/renamed a file intentionally and forget to update CMakeLists.txt (or just rerun `make` which executes `cmake`) <br><br></div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
That said, I can see how the proposed feature might be useful when<br>
iteratively developing in an IDE.  Add the file to `CMakeLists.txt`,<br>
reconfigure, and open the new (now existing) file to edit in the IDE.<br></blockquote><div><br></div></span><div>my personal practice completely the opposite:<br></div><div>in my CMakeLists I have a custom target to generate a source file from the project specific template, so I just use CLI to generate a new file like:<br><br></div><div>    $ make new-class name=BlahBlah ns=Vendor::Project subdir=some/dir<br><br></div><div>and then go to corresponding CMakeLists.txt and add the generated source(s) to a target<br></div><div>and thanks to `cmake` missed files are reported at configuration time<br><br></div><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span><br>
> Is this something that would be acceptable into CMake? Any comments?<br>
<br>
</span>I'd like to hear more opinions from others before considering it<br>
upstream.  It feels like a pretty personal workflow right now, and<br>
can be implemented in CMake code already (perhaps with the `SOURCES`<br>
target property to avoid separate lists).<br>
<br>
If this were to be done I'd first like to see a policy introduced to<br>
get rid of the magic extension guessing we do now.  Without knowing<br>
the full file name with confidence we wouldn't be able to create it.<br>
<br>
-Brad<br>
<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" rel="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" target="_blank">http://www.cmake.org/Wiki/CMak<wbr>e_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" target="_blank">http://cmake.org/cmake/help/su<wbr>pport.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/co<wbr>nsulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/tr<wbr>aining.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/opensou<wbr>rce/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/cmake-developers" rel="noreferrer" target="_blank">http://public.kitware.com/mail<wbr>man/listinfo/cmake-developers</a><br>
</blockquote></span></div><br></div></div></div></div>
</div><br></div>