CMake project uses local version of g ++

I am using MacOS X Lion with Xcode 4.2.1. and i need gcc 2.4.6. to compile the CMake project. Therefore, I am building gcc 2.4.6. independently in the local directory $HOME/mygcc/bin. Is there a way to increase the path to a compiler that uses CMake?

+3
source share
2 answers

You can use the GUI to set these variables:

CMAKE_C_COMPILER=$HOME/mygcc/bingcc
CMAKE_CXX_COMPILER=$HOME/mygcc/bing++

Or you can run cmakefrom the command line:

cmake ../path/to/source -DCMAKE_C_COMPILER=$HOME/mygcc/bin/gcc -DCMAKE_CXX_COMPILER=$HOME/mygcc/bin/g++
+4
source

You can set the local gcc bin directory in $PATHbefore starting cmake:

$ export PATH=$HOME/mygcc/bin:$PATH
$ cmake
0
source

All Articles