MantisBT - CMake
View Issue Details
0007097CMakeModulespublic2008-05-26 04:292008-07-03 16:00
Martin Apel 
Douglas Gregor 
normalmajoralways
closedfixed 
CMake-2-6 
CMake-2-6 
0007097: FindBoost on Linux misinterprets compiler version info for library search if compiler name contains version number
If the compiler name on Linux is e.g. gcc-4.2, then the FindBoost module
searches for boost libraries containing the version string
  -gccg++-4.2 (GCC) 4.2.2
instead of
  -gcc42

The statement
        STRING(REGEX REPLACE ".* ([0-9])\\.([0-9])\\.[0-9] .*" "\\1\\2"
               _boost_COMPILER_VERSION ${_boost_COMPILER_VERSION})

inside FindBoost.cmake seems to fail in this case. The cause is probably the trailing blank required by the regular expression, which is not always there.

The result of this bug is that Boost is never found in this configuration.
The output of gcc --version on this machine is
  gcc (GCC) 4.1.1 20070105 (Red Hat 4.1.1-52)
The output of gcc-4.2 --version on this machine is
  gcc-4.2 (GCC) 4.2.2

It would probably be better to use a regular expression such as
  ".*\\(GCC\\) ([0-9])\\.([0-9])\\.[0-9].*"
(untested)
No tags attached.
Issue History
2008-05-26 04:29Martin ApelNew Issue
2008-05-26 09:47Bill HoffmanStatusnew => assigned
2008-05-26 09:47Bill HoffmanAssigned To => Douglas Gregor
2008-07-03 15:52Douglas GregorStatusassigned => resolved
2008-07-03 15:52Douglas GregorFixed in Version => CMake-2-6
2008-07-03 15:52Douglas GregorResolutionopen => fixed
2008-07-03 15:52Douglas GregorNote Added: 0012615
2008-07-03 16:00Douglas GregorStatusresolved => closed

Notes
(0012615)
Douglas Gregor   
2008-07-03 15:52   
Fixed in CMake CVS