When you run `cmake --build Build` it doesn't run cmake with the --warn-uninitialized if the build files need to be regenerated. Therefore you don't get the warnings.
On Tue, Feb 5, 2019 at 12:15 PM Ramold, Felix <felix.ram...@kuka.com> wrote: > 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.mayn...@kitware.com] > Gesendet: Montag, 4. Februar 2019 18:16 > An: Ramold, Felix > Cc: cmake@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.ram...@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 > -- > > 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 >
-- 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