MantisBT - CMake
View Issue Details
0011679CMakeModulespublic2011-01-10 17:142011-01-26 15:27
Emmanuel Blot 
Alex Neundorf 
normalmajoralways
closedfixed 
AppleMac OS X10.6.6
CMake 2.8.3 
 
0011679: CMAKE_FORCE_C_COMPILER fails to parse compiler name that contains a version number
Using the following commands:
  FIND_PROGRAM (xcc arm-eabi-gcc)
  CMAKE_FORCE_C_COMPILER (${xcc} GNU)
works as expected.

RANLIB and AR commands are mapped to the same target, namely:
arm-eabi-ranlib and arm-eabi-ar
  
However, when a version is specified:
  FIND_PROGRAM (xcc arm-eabi-gcc-4.5.2)
  CMAKE_FORCE_C_COMPILER (${xcc} GNU)
RANLIB and AR commands are left to the default, host tools (which lead to later compilation errors)

In this latter case, the _CMAKE_TOOLCHAIN_PREFIX is left empty. It seems that the compiler string parser is in trouble.
The issue occurs whatever the platform (at least tested on Cygwin and Mac OS X), and it seems it may also occur with CMAKE_C_COMPILER.
No tags attached.
Issue History
2011-01-10 17:14Emmanuel BlotNew Issue
2011-01-17 17:03David ColeAssigned To => Alex Neundorf
2011-01-17 17:03David ColeStatusnew => assigned
2011-01-26 12:25Alex NeundorfNote Added: 0025093
2011-01-26 15:27Alex NeundorfNote Added: 0025097
2011-01-26 15:27Alex NeundorfStatusassigned => closed
2011-01-26 15:27Alex NeundorfResolutionopen => fixed
2011-01-26 15:27Alex NeundorfCategoryCMake => Modules

Notes
(0025093)
Alex Neundorf   
2011-01-26 12:25   
This is the regexp which is used:
IF (COMPILER_BASENAME MATCHES "^(.+-)g?cc(\\.exe)?$")

so it would match "arm-eabi-gcc.exe" and "arm-eabi-gcc", but it doesn't match arm-eabi-gcc-x.y.z(.exe)?.
I'll have a look.

Alex
(0025097)
Alex Neundorf   
2011-01-26 15:27   
I changed the regex so it now accepts a version number and pushed this to the next branch.
Not sure whether it will still make it into 2.8.4.

Alex