--warn-uninitialized works in only first configuration

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

--warn-uninitialized works in only first configuration

Ramold, Felix

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
Reply | Threaded
Open this post in threaded view
|

Re: --warn-uninitialized works in only first configuration

CMake mailing list
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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: --warn-uninitialized works in only first configuration

Ramold, Felix
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:[hidden email]]
Gesendet: Montag, 4. Februar 2019 18:16
An: Ramold, Felix
Cc: [hidden email]
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 <[hidden email]> 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

terminal.txt (11K) Download Attachment
CMakeLists.txt (198 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: --warn-uninitialized works in only first configuration

CMake mailing list
Okay now I understand.

Yes this is the intended behavior of `--warn-uninitialized`.

It is designed so that it will only generate warnings for the explicit
invocation of cmake that includes the flag. Subsequent calls to
`cmake` without `--warn-uninitialized` will generate no warnings.

On Tue, Feb 5, 2019 at 12:08 PM Ramold, Felix <[hidden email]> 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:[hidden email]]
> Gesendet: Montag, 4. Februar 2019 18:16
> An: Ramold, Felix
> Cc: [hidden email]
> 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 <[hidden email]> 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
Reply | Threaded
Open this post in threaded view
|

Re: --warn-uninitialized works in only first configuration

frodak17
In reply to this post by Ramold, Felix
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 <[hidden email]> 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:[hidden email]]
Gesendet: Montag, 4. Februar 2019 18:16
An: Ramold, Felix
Cc: [hidden email]
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 <[hidden email]> 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