[CMake] --warn-uninitialized works in only first configuration

Ramold, Felix Felix.Ramold at kuka.com
Tue Feb 5 12:08:28 EST 2019


It is not a cache variable. Here is an example:

cmake_minimum_required(VERSION 3.10)
project(TEST_UNINITIALIZED)

file(WRITE dummy.cpp "")
add_library(dummy dummy.cpp ${UNINITIALIZED})

Also UNINITIALIZED is not added to CMakeCache.txt.
Calling cmake twice (even without a change to the list) also shows this warning.

-----Ursprüngliche Nachricht-----
Von: Robert Maynard [mailto:robert.maynard at kitware.com] 
Gesendet: Montag, 4. Februar 2019 18:16
An: Ramold, Felix
Cc: cmake at cmake.org
Betreff: Re: [CMake] --warn-uninitialized works in only first configuration

This generally occurs with CACHE variables as for non first runs they
exist in the cache and therefore are initialized.

On Mon, Feb 4, 2019 at 10:16 AM Ramold, Felix <Felix.Ramold at kuka.com> wrote:
>
> Hi,
>
>
>
> I configure a project with --warn-uninitialized and get a lot of warnings. I successfully run the build.
>
> Then I change any CMakeLists.txt file. I run the build again. CMake checks its dependencies and reconfigures before the actual build.
>
> Those warnings (or at least those in the edited file) don’t appear again.
>
> Is this the standard behavior?
>
>
>
> Thanks,
>
> Felix
>
> --
>
> 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:
> https://cmake.org/mailman/listinfo/cmake
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: terminal.txt
URL: <https://cmake.org/pipermail/cmake/attachments/20190205/67eeab5e/attachment.txt>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: CMakeLists.txt
URL: <https://cmake.org/pipermail/cmake/attachments/20190205/67eeab5e/attachment-0001.txt>


More information about the CMake mailing list