I'd like to build my application such that debug mode is a console application and release mode is a Win32 application. According to the documentation I need to add WIN32
to add_executable
depending on whether I want a console application or not.
Because I'm using Visual Studio, I can't use CMAKE_BUILD_TYPE
(the generated project contains multiple configurations). How can I tell CMAKE to use WIN32
for release builds and omit it for debug builds?