<div dir="ltr">When you run `cmake --build Build` it doesn't run cmake with the
<span lang="EN-US">--warn-uninitialized if the build files need to be regenerated</span><span lang="EN-US">.  Therefore you don't get the warnings.</span>

</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Feb 5, 2019 at 12:15 PM Ramold, Felix <<a href="mailto:Felix.Ramold@kuka.com">Felix.Ramold@kuka.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">It is not a cache variable. Here is an example:<br>
<br>
cmake_minimum_required(VERSION 3.10)<br>
project(TEST_UNINITIALIZED)<br>
<br>
file(WRITE dummy.cpp "")<br>
add_library(dummy dummy.cpp ${UNINITIALIZED})<br>
<br>
Also UNINITIALIZED is not added to CMakeCache.txt.<br>
Calling cmake twice (even without a change to the list) also shows this warning.<br>
<br>
-----Ursprüngliche Nachricht-----<br>
Von: Robert Maynard [mailto:<a href="mailto:robert.maynard@kitware.com" target="_blank">robert.maynard@kitware.com</a>] <br>
Gesendet: Montag, 4. Februar 2019 18:16<br>
An: Ramold, Felix<br>
Cc: <a href="mailto:cmake@cmake.org" target="_blank">cmake@cmake.org</a><br>
Betreff: Re: [CMake] --warn-uninitialized works in only first configuration<br>
<br>
This generally occurs with CACHE variables as for non first runs they<br>
exist in the cache and therefore are initialized.<br>
<br>
On Mon, Feb 4, 2019 at 10:16 AM Ramold, Felix <<a href="mailto:Felix.Ramold@kuka.com" target="_blank">Felix.Ramold@kuka.com</a>> wrote:<br>
><br>
> Hi,<br>
><br>
><br>
><br>
> I configure a project with --warn-uninitialized and get a lot of warnings. I successfully run the build.<br>
><br>
> Then I change any CMakeLists.txt file. I run the build again. CMake checks its dependencies and reconfigures before the actual build.<br>
><br>
> Those warnings (or at least those in the edited file) don’t appear again.<br>
><br>
> Is this the standard behavior?<br>
><br>
><br>
><br>
> Thanks,<br>
><br>
> Felix<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/CMake_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/support.html</a><br>
> CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
> CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.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/opensource/opensource.html</a><br>
><br>
> Follow this link to subscribe/unsubscribe:<br>
> <a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><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/CMake_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/support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/training.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/opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div>