Bug 185826

Summary: error with MacroEnsureVersion.cmake:76 with ccache
Product: [Developer tools] buildsystem Reporter: Christophe Marin <christophe>
Component: KDE4 (cmake)Assignee: Alexander Neundorf <neundorf>
Status: RESOLVED INTENTIONAL    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Christophe Marin 2009-02-28 20:21:53 UTC
Version:            (using Devel)
Compiler:          4.4 
OS:                Linux
Installed from:    Compiled sources

I'm using ccache to build KDE and have an issue with kdepimlibs.

Previously, ccache was in /usr/local/bin and a few symlinks were created for g++ and gcc. and everything was fine.

Today, I removed these files and changed my .bashrc :

export CC="ccache gcc"
export CXX="ccache g++"

and now, kdepimlibs fails:

cmake /home/krop/kde/src/KDE/kdepimlibs -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/kde4/kdepimlibs -DKDE4_BUILD_TESTS=on
-- The C compiler identification is GNU

   
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/bin/ccache
-- Check for working C compiler: /usr/bin/ccache -- works  
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/ccache  
-- Check for working CXX compiler: /usr/bin/ccache -- works
-- Detecting CXX compiler ABI info 
-- Detecting CXX compiler ABI info - done
-- Looking for Q_WS_X11  
-- Looking for Q_WS_X11 - found 
-- Looking for Q_WS_WIN  
-- Looking for Q_WS_WIN - not found.   
-- Looking for Q_WS_QWS  
-- Looking for Q_WS_QWS - not found.   
-- Looking for Q_WS_MAC  
-- Looking for Q_WS_MAC - not found.   
-- Found Qt-Version 4.5.0-rc1 (using /usr/bin/qmake)
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so;/usr/lib/libXft.so;/usr/lib/libXau.so;/usr/lib/libXdmcp.so;/usr/lib/libXpm.so
-- Looking for XOpenDisplay in /usr/lib/libX11.so;/usr/lib/libXext.so;/usr/lib/libXft.so;/usr/lib/libXau.so;/usr/lib/libXdmcp.so;/usr/lib/libXpm.so - found   
-- Looking for gethostbyname   
-- Looking for gethostbyname - found   
-- Looking for connect
-- Looking for connect - found  
-- Looking for remove
-- Looking for remove - found   
-- Looking for shmat 
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found   
-- Found X11: /usr/lib/libX11.so
-- Looking for include files CMAKE_HAVE_PTHREAD_H   
-- Looking for include files CMAKE_HAVE_PTHREAD_H - found  
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found  
-- Looking for pthread_create in pthread 
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE   
-- Found Automoc4: /usr/bin/automoc4   
-- Found Perl: /usr/bin/perl
-- Performing Test _OFFT_IS_64BIT  
-- Performing Test _OFFT_IS_64BIT - Failed   
-- Performing Test HAVE_FPIE_SUPPORT   
-- Performing Test HAVE_FPIE_SUPPORT - Success  
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL  
-- Performing Test __KDE_HAVE_W_OVERLOADED_VIRTUAL - Success  
-- Performing Test __KDE_HAVE_GCC_VISIBILITY 
-- Performing Test __KDE_HAVE_GCC_VISIBILITY - Success 
   
CMake Error at /usr/share/kde4/apps/cmake/modules/MacroEnsureVersion.cmake:76
(MATH):
  math cannot parse the expression: "/usr/bin/ccache: invalid option -- '-' 

  ccache, a compiler cache.  Version 2
  Copyright Andrew Tridgell, 2002

  Usage:

 ccache [options]
 ccache compiler [compile options]
 compiler [compile options] (via symbolic link)

etc...


removing ccache from the above exports solves this issue.
Comment 1 Christophe Marin 2009-02-28 21:57:13 UTC
to be more accurate (I don't think MacroEnsureVersion is the cause) :

CMake Error at /usr/share/kde4/apps/cmake/modules/MacroEnsureVersion.cmake:76 (MATH):
  math cannot parse the expression: "/usr/bin/ccache: invalid option -- '-'

  ccache, a compiler cache.  Version 2

[here, the ccache params are listed]

  -V print version number*10000 + /usr/bin/ccache: invalid option -- '-'

  ccache, a compiler cache.  Version 4

[here, the ccache params are listed]

  -V print version number*100 + 0": syntax error, unexpected exp_DIVIDE,
  expecting exp_OPENPARENT or exp_NUMBER (1)
Call Stack (most recent call first):
  /usr/share/kde4/apps/cmake/modules/MacroEnsureVersion.cmake:95 (NORMALIZE_VERSION)
  /usr/share/kde4/apps/cmake/modules/FindKDE4Internal.cmake:1028 (macro_ensure_version)
  /usr/local/share/cmake-2.6/Modules/FindKDE4.cmake:81 (FIND_PACKAGE)
  CMakeLists.txt:11 (find_package)


CMake Error at /usr/share/kde4/apps/cmake/modules/MacroEnsureVersion.cmake:76 (MATH):
  math cannot parse the expression: "/usr/bin/ccache: invalid option -- '-'

  ccache, a compiler cache.  Version 2
Comment 2 Christophe Marin 2012-01-05 17:19:37 UTC
closing. too much dust on this report