On 04/11/2017 11:41 AM, Petr Kmoch wrote:
> Currently, adding a new source file to a CMake-controlled project
> means doing two things: creating the file on disk, and adding it
> to the relevant CMakeList add_library() or add_executable() call.

I view this as a matching pair with an implicit sanity check.

> switch from current behaviour of "error out if source file is not found"
> to "create empty source file if it's not found."

So a typo in the `CMakeLists.txt` file leads to silent creation of a
source file instead of an error message?

That said, I can see how the proposed feature might be useful when
iteratively developing in an IDE.  Add the file to `CMakeLists.txt`,
reconfigure, and open the new (now existing) file to edit in the IDE.

> Is this something that would be acceptable into CMake? Any comments?

I'd like to hear more opinions from others before considering it
upstream.  It feels like a pretty personal workflow right now, and
can be implemented in CMake code already (perhaps with the `SOURCES`
target property to avoid separate lists).

If this were to be done I'd first like to see a policy introduced to
get rid of the magic extension guessing we do now.  Without knowing
the full file name with confidence we wouldn't be able to create it.

-Brad

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to