[CMake] Is this an intended change to cmake behavior in cmake 3.12?

Brad King brad.king at kitware.com
Tue Jul 24 10:28:05 EDT 2018


On 07/20/2018 11:48 AM, Buster, James wrote:
> Using cmake 3.12: the second “cmake .” issues the following warning:
> CMake Warning (dev) in CMakeLists.txt:
>   Policy CMP0048 is not set: project() command manages VERSION variables.

Thanks.  I opened an issue for it:

  https://gitlab.kitware.com/cmake/cmake/issues/18202

Please see that issue for further discussion.

> See the “test_project2” macro in CMakeLists.txt? Simply uncomment it.
> Even though it isn’t called, uncommenting that macro causes the
> “Policy CMP0048” warning to disappear.

If no project() command appears anywhere in the top-level CMakeLists.txt
file then one is injected on line zero.  That is the one that causes
the warning.  When it is present in the inline macro then no injection
is done.  It's strange but that's how things evolved.

-Brad


More information about the CMake mailing list