<div dir="ltr">Thank you for your answer!<div><br></div><div>What I found strange is that CMAKE_CONFIGURATION_TYPES and CMAKE_BUILD_TYPE are empty at the begining of the cmake script. </div><div><br></div><div>When do those variables instanciated?</div><div><br></div><div>The purpose to know if the build type changed is to reactivate a superbuild variable to build my external dependencies in the good build type.</div></div><br><div class="gmail_quote"><div dir="ltr">Le sam. 5 janv. 2019 à 17:35, frodak17 <<a href="mailto:frodak17@gmail.com">frodak17@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr">On Sat, Jan 5, 2019 at 11:08 AM Romain LEGUAY <<a href="mailto:romain.leguay@gmail.com" target="_blank">romain.leguay@gmail.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"><div dir="ltr"><div dir="ltr"><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">Hi everyone,</p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"> </p>
<p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">Is there a way to test if the build type changed?</p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:11pt"><br></span></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><span style="font-size:11pt">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).</span><br></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif">Thank you,</p><p class="MsoNormal" style="margin:0cm 0cm 0.0001pt;font-size:11pt;font-family:Calibri,sans-serif"><br></p></div></div></blockquote><div><br></div><div><span style="font-size:11pt">CMAKE_CONFIGURATION_TYPES</span> is used by multi-config generators and CMAKE_BUILD_TYPE isn't used.</div><div>
<span style="font-size:11pt">CMAKE_CONFIGURATION_TYPES</span> should default to "Debug;Release;MinSizeRel;RelWithDebInfo" for Visual Studio generators unless it was explicitly set to something else.<br></div><div><br></div><div>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.</div><div><br></div><div>When building with Visual Studio the build type probably could be written to a file using a post-build rule or something like that.<br></div></div></div></div>
</blockquote></div>