On Sat, Jan 5, 2019 at 11:08 AM Romain LEGUAY <romain.leg...@gmail.com>
wrote:

> Hi everyone,
>
>
>
> Is there a way to test if the build type changed?
>
>
> I try to create a cache variable with CMAKE_BUILD_TYPE as value but I
> found an unexpected result: CMAKE_BUILD_TYPE or CMAKE_CONFIGURATION_TYPES
> are not defined (I'm working on Windows with Visual Studio 2017, Visual
> Studio Code and Qt Creator).
>
>
> Thank you,
>
>
>
CMAKE_CONFIGURATION_TYPES is used by multi-config generators and
CMAKE_BUILD_TYPE isn't used.
CMAKE_CONFIGURATION_TYPES should default to
"Debug;Release;MinSizeRel;RelWithDebInfo" for Visual Studio generators
unless it was explicitly set to something else.

If you aren't using a multi-config generator then CMAKE_BUILD_TYPE will be
empty unless it was set by the user or the CMakeLists.txt sets a default
value if empty.

When building with Visual Studio the build type probably could be written
to a file using a post-build rule or something like that.
-- 

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 via email to