From 5c88935a88458d53a1e16e818bf77d96edf83006 Mon Sep 17 00:00:00 2001 From: Magne Sjaastad Date: Thu, 25 Apr 2013 12:00:58 +0200 Subject: [PATCH] Hide console window in release config on Windows p4#: 21433 --- ApplicationCode/RiaMain.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/ApplicationCode/RiaMain.cpp b/ApplicationCode/RiaMain.cpp index 5804647de9..3b04855b53 100644 --- a/ApplicationCode/RiaMain.cpp +++ b/ApplicationCode/RiaMain.cpp @@ -21,6 +21,32 @@ #include "RiuMainWindow.h" +// Cmake is able to control subsystem on Windows using the following method http://www.cmake.org/Wiki/VSConfigSpecificSettings +// +// if(WIN32) +// set_target_properties(WindowApplicationExample PROPERTIES LINK_FLAGS_DEBUG "/SUBSYSTEM:CONSOLE") +// set_target_properties(WindowApplicationExample PROPERTIES COMPILE_DEFINITIONS_DEBUG "_CONSOLE") +// set_target_properties(WindowApplicationExample PROPERTIES LINK_FLAGS_RELWITHDEBINFO "/SUBSYSTEM:CONSOLE") +// set_target_properties(WindowApplicationExample PROPERTIES COMPILE_DEFINITIONS_RELWITHDEBINFO "_CONSOLE") +// set_target_properties(WindowApplicationExample PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS") +// set_target_properties(WindowApplicationExample PROPERTIES LINK_FLAGS_MINSIZEREL "/SUBSYSTEM:WINDOWS") +// endif(WIN32) +// +// +// Due to a bug in Cmake, use workaround described here http://public.kitware.com/Bug/view.php?id=12566 +#if defined(_MSC_VER) && defined(_WIN32) + + #ifdef _DEBUG + #pragma comment(linker, "/SUBSYSTEM:CONSOLE") + #else + #pragma comment(linker, "/SUBSYSTEM:WINDOWS") + #endif // _DEBUG + +#endif // defined(_MSC_VER) && defined(_WIN32) + + + + int main(int argc, char *argv[]) { RiaApplication app(argc, argv);