I'm quite confused.
I'm using the Eval version of CLion on OS X 10.10.1 (MAVERICKS). I have Xcode : Version 6.3.1 (6D1002) installed. I also have gcc-5.1.0 installed on this machine.
I want to use the gcc/g++ compilers from gcc-5.1.0. But I cannot see how to change these settings... I must be missing something.
An image of my Toolchains Preferences is below. Notice that the C and C++ Compiler options point at the cc and c++ from Xcode. cc and c++ are both symbolic links to clang in the Xcode folder.
Now, for testing purposes, I have simply changed these symbolic links to point at the gcc-5.1.0 and g++-5.1.0 compilers respectively. Everything works fine... But, my Xcode environment is now broken...
How do I accomplish this task "properly" ??? This is my first exposure to CMake...do I make these settings in the CMakeLists.txt file and then the changes will be reflected in the Toolchains Preferences ??? If so, please provide the syntax. I think it might be the following :
the compiler used for C files. Normally it is detected and set during the CMake run, but you can override it at configuration time. Note! It can not be changed after the first cmake or ccmake run. Although the gui allows to enter an alternative, it will be ignored in the next 'configure' run. Use for example:
CC=gcc-3.3 CXX=g++-3.3 cmake
to set the compiler. (You can also set CMAKE_C_COMPILER_INIT, before any PROJECT() or ENABLE_LANGUAGE() command.) Any other way (like writing make CC=gcc-3.3 CXX=g++-3.3) will not work. When using distcc or similar tools, you need to write:
CC="distcc gcc-3.3" CXX="distcc g++-3.3" cmake
However, this will empty all your CMAKE_..._FLAGS_... above.
- the compiler used for C++ files. Normally it is detected and set during the CMake run, but you can override it at configuration time. Note! It can not be changed after the first cmake or ccmake run. See CMAKE_C_COMPILER above.
But what is this note in the description for CMAKE_C_COMPILER, "Note! It can not be changed after the first cmake or ccmake run." ?? Please point me at an explanation of what, precisely, this means.
And, where is the best documentation for CMake ???
As I write this, I am learning more and I think I see where this is going... But, I'll shutup for now and let someone respond who has a better understanding of this topic.