On 2014-01-15 16:25, Alexander Neundorf wrote:
On Wednesday 15 January 2014, Alexander Neundorf wrote:
And, to actually produce the breakage, at some place the VERSION argument
must have been added.
With the current state of my branch, this could be worked around by
unsetting the guard variable:


project(Foo VERSION 1.2.3)
....

unset(CMAKE_PROJECT_VERSION_SET_BY_PROJECT_COMMAND)
add_subdir(B)

This way B would be protected from that change in behaviour.

I could also add more logic, to try to detect if PROJECT_VERSION has been set
manually, e.g. project() could reset PROJECT_VERSION only if it has the same
value as ${${ParentProjectName}_VERSION}. Then it would only break if there
was a manual set(PROJECT_VERSION ...) before a project() call without VERSION,
and if that manually set version was the same as the version in the "parent
project".

IMHO your last suggestion (very good idea, btw!) is more than adequate, especially given the original weakness of my "objection" (which was always more along the lines of "did you consider this case, and should we worry about it?").

--
Matthew

--

Powered by www.kitware.com

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

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

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

Reply via email to