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

2019-02-05 Thread frodak17
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  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 
> 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


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

2019-02-05 Thread Robert Maynard via CMake
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  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  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


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

2019-02-05 Thread 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: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  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
D:\CMake>cmake . -BBuild --warn-uninitialized
Warn about uninitialized values.
-- Building for: Visual Studio 14 2015
-- The C compiler identification is MSVC 19.0.23918.0
-- The CXX compiler identification is MSVC 19.0.23918.0
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 
14.0/VC/bin/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio 
14.0/VC/bin/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual 
Studio 14.0/VC/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual 
Studio 14.0/VC/bin/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
CMake Warning (dev) at CMakeLists.txt:5 (add_library):
  uninitialized variable 'UNINITIALIZED'
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: D:/CMake/Build

D:\CMake>cmake . -BBuild --warn-uninitialized
Warn about uninitialized values.
CMake Warning (dev) at CMakeLists.txt:5 (add_library):
  uninitialized variable 'UNINITIALIZED'
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: D:/CMake/Build

D:\CMake>cmake --build Build
Microsoft (R)-Buildmodul, Version 14.0.25123.0
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

Der Buildvorgang wurde am 05.02.2019 18:03:39 gestartet.
Projekt "D:\CMake\Build\ALL_BUILD.vcxproj" auf Knoten "1" (Standardziele).
Das Projekt "D:\CMake\Build\ALL_BUILD.vcxproj" (1) erstellt 
"D:\CMake\Build\ZERO_CHECK.vcxproj" (2) auf Knoten "1" (Standardziele).
PrepareForBuild:
  Das Verzeichnis "Win32\Debug\ZERO_CHECK\" wird erstellt.
  Das Verzeichnis "D:\CMake\Build\Debug\" wird erstellt.
  Das Verzeichnis "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\" wird erstellt.
InitializeBuildStatus:
  "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" wird erstellt, da 
"AlwaysCreate" angegeben wurde.
CustomBuild:
  Checking Build System
  CMake does not need to re-run because 
D:/CMake/Build/CMakeFiles/generate.stamp is up-to-date.
FinalizeBuildStatus:
  Die Datei "Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" wird 
gelöscht.
  Aktualisieren des Timestamps von 
"Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
Die Erstellung von Projekt "D:\CMake\Build\ZERO_CHECK.vcxproj" ist 
abgeschlossen (Standardziele).

Das Projekt "D:\CMake\Build\ALL_BUILD.vcxproj" (1) erstellt 
"D:\CMake\Build\dummy.vcxproj" (3) auf Knoten "1" (Standardziele).
PrepareForBuild:
  Das Verzeichnis "dummy.dir\Debug\" wird erstellt.
  Das Verzeichnis "dummy.di

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

2019-02-04 Thread Robert Maynard via CMake
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  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


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

2019-02-04 Thread 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