Skip to content

Commit 7679020

Browse files
author
Brig Bagley
committed
command prompt only shows on debug.
1 parent d18b291 commit 7679020

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/ShapeWorksView2/CMakeLists.txt

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,14 @@ ELSE ( BUILD_SWV2_OSX_APP )
141141
)
142142
ENDIF ( BUILD_SWV2_OSX_APP )
143143

144+
IF(WIN32) # Check if we are on Windows
145+
if(MSVC) # Check if we are using the Visual Studio compiler
146+
set_target_properties(ShapeWorksView2 PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS /ENTRY:\"mainCRTStartup\"")
147+
else()
148+
message(SEND_ERROR "You are using an unsupported Windows compiler! (Not MSVC)")
149+
endif()
150+
ENDIF()
151+
144152

145153
TARGET_LINK_LIBRARIES( ShapeWorksView2
146154
${QT_LIBRARIES}
@@ -149,7 +157,11 @@ TARGET_LINK_LIBRARIES( ShapeWorksView2
149157
ITKParticleSystem tinyxml
150158
)
151159

152-
160+
if(WIN32)
161+
if(MSVC)
162+
set_target_properties(ShapeWorksView2 PROPERTIES LINK_FLAGS_RELEASE "/SUBSYSTEM:WINDOWS")
163+
endif()
164+
endif()
153165

154166
# INSTALLATION AND PACKAGING
155167
SET(plugin_dest_dir bin)

src/ShapeWorksView2/main.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,10 @@ int main( int argc, char** argv )
9595
{
9696
#ifdef WIN32
9797
::SetErrorMode( 0 );
98+
#ifdef _DEBUG
9899
RedirectIOToConsole2();
99100
#endif
100-
101+
#endif
101102
try {
102103

103104
#ifdef WIN32

0 commit comments

Comments
 (0)