View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0011682CMakeCMakepublic2011-01-11 08:322011-01-15 20:56
ReporterMaddes 
Assigned ToBrad King 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionduplicate 
PlatformMinGW/GCCOSWindows XPOS Versionx86, SP3
Product VersionCMake 2.8.3 
Target VersionFixed in Version 
Summary0011682: [enhancement] Add GNU versions for CMakeLists.txt processing, just like MSVC_VERSION
DescriptionIt would be great to determine the version of the GNU compiler, so that options can be avoided for older/newer versions of GCC and G++ (e.g. -Wextra, etc.).
A similar variable for VisualC++ already exists: MSVC_VERSION.

GCC/G++ already provide their version number via the macro definitions __GNUC__ (=major), __GNUC_MINOR__, __GNUC_PATCHLEVEL__.

Having GNU<LANG>_MAJOR, GNU<LANG>_MINOR, GNU<LANG>_PATCHLEVEL available for use in CMakeLists.txt would be very useful.
TagsNo tags attached.
Attached Files

 Relationships
duplicate of 0006251closedBrad King Provide compiler version information 

  Notes
(0024575)
Brad King (manager)
2011-01-11 08:47

This would be a great feature.

Closing as duplicate of 0006251. You can monitor that issue instead.

Here are some alternatives to use for your case, useful when CMAKE_C_COMPILER_ID is GNU:

 - Use execute_process to run "gcc --version"
 - Do your own try_compile to detect the GCC version number
 - Use the CheckCCompilerFlag to detect support for specific flags

 Issue History
Date Modified Username Field Change
2011-01-11 08:32 Maddes New Issue
2011-01-11 08:41 Brad King Relationship added duplicate of 0006251
2011-01-11 08:47 Brad King Note Added: 0024575
2011-01-11 08:47 Brad King Status new => closed
2011-01-11 08:47 Brad King Assigned To => Brad King
2011-01-11 08:47 Brad King Resolution open => duplicate


Copyright © 2000 - 2018 MantisBT Team