View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013292CMakeCMakepublic2012-06-11 16:242012-11-05 14:33
ReporterRyan H. Kawicki 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformWindowsOS7OS Version6.1.7601
Product VersionCMake 2.8.7 
Target VersionFixed in Version 
Summary0013292: Windows : CMake Does Not Define _CONSOLE When Not Building A Win32 Target
DescriptionCommand add_executable does not define _CONSOLE when WIN32 is not specified.

Expected that final output would have _CONSOLE defined for preprocessor definitions if WIN32 is not specified and _WINDOWS when WIN32 is specified.
Steps To ReproduceCreate a very simple test with one single file.
Additional Informationproject(test-console)

add_executable(test test.cpp)

# the generated project has _WINDOWS define when _CONSOLE should be defined.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0029662)
Brad King (manager)
2012-06-11 16:59

Can you link to documentation that claims this macro is standard in any way?
(0029663)
Ryan H. Kawicki (reporter)
2012-06-11 19:40

I could not find any documentation on _CONSOLE or _WINDOWS and it isn't even listed under their standard predefined macros.

I am only observing this from Visual Studio. When creating a console application, _CONSOLE is defined in the predefined symbols. When creating a GUI application, _WINDOWS is defined.

This became an issue when upgrading to CMake with a project that had a console application. Apparently, some 3rd party libraries use this flag. We were able to get around it by removing _WINDOWS and defining _CONSOLE ourselves.

I just wanted to bring this to the developers attention and to see if this truly needed to be addressed.
(0031449)
David Cole (manager)
2012-11-05 14:33

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2012-06-11 16:24 Ryan H. Kawicki New Issue
2012-06-11 16:59 Brad King Note Added: 0029662
2012-06-11 19:40 Ryan H. Kawicki Note Added: 0029663
2012-06-12 08:13 Brad King Status new => resolved
2012-06-12 08:13 Brad King Resolution open => no change required
2012-11-05 14:33 David Cole Note Added: 0031449
2012-11-05 14:33 David Cole Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team