<div dir="ltr"><div><div><div><div>Hi Surya.<br><br></div>Generator expressions are not supported universally in CMake; only some properties support them, and they are all documented as doing so. WIN32_EXECUTABLE does not support genexes.<br><br></div>As for a workaround, you could create two executable targets, one which would only be built in Release and one which would be built in other configurations. Properties such as EXCLUDE_FROM_ALL and EXCLUDE_FROM_DEFAULT_BUILD_<CONFIG> might come in handy.<br><br></div>However, I find the whole concept somewhat strange. Why is your executable so fundamentally different between Release and other configurations? Perhaps there is a different way of achieving your actual goal, without a need for this.<br><br></div>Petr<br></div><div class="gmail_extra"><br><div class="gmail_quote">On 13 May 2018 at 13:12, Surya Kiran Gullapalli <span dir="ltr"><<a href="mailto:suryakiran.gullapalli@gmail.com" target="_blank">suryakiran.gullapalli@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000">With Cmake-3.11.1 and Visual Studio 2017 generator, I'm trying to set WIN32_EXECUTABLE property on executable only for release mode with generator expression like this</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000">set_target_properties(target PROPERTIES WIN32_EXECUTABLE $<CONFIG:Release>)</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000">The generator expression doesn't seem to be working as I see /SUBSYSTEM:CONSOLE link flag for both Debug and Release configurations.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000">set_target_properties(target PROPERTIES WIN32_EXECUTABLE 1)  is working though. </div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000"><br></div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000">Please help.</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000">Thanks,</div><div class="gmail_default" style="font-family:trebuchet ms,sans-serif;color:#660000">Surya</div></div>
<br>-- <br>
<br>
Powered by <a href="http://www.kitware.com" rel="noreferrer" target="_blank">www.kitware.com</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" rel="noreferrer" target="_blank">http://www.cmake.org/Wiki/<wbr>CMake_FAQ</a><br>
<br>
Kitware offers various services to support the CMake community. For more information on each offering, please visit:<br>
<br>
CMake Support: <a href="http://cmake.org/cmake/help/support.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>support.html</a><br>
CMake Consulting: <a href="http://cmake.org/cmake/help/consulting.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>consulting.html</a><br>
CMake Training Courses: <a href="http://cmake.org/cmake/help/training.html" rel="noreferrer" target="_blank">http://cmake.org/cmake/help/<wbr>training.html</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" rel="noreferrer" target="_blank">http://www.kitware.com/<wbr>opensource/opensource.html</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="https://cmake.org/mailman/listinfo/cmake" rel="noreferrer" target="_blank">https://cmake.org/mailman/<wbr>listinfo/cmake</a><br>
<br></blockquote></div><br></div>