Re: WIN32_EXECUTABLE property with generator expression
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.
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.
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.
On 13 May 2018 at 13:12, Surya Kiran Gullapalli <[hidden email]> wrote:
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