Wrong Path in CMAKE_C_COMPILER

Hi,

How can I change permanently CMAKE_C_COMPILER for CLion?

File/Settings/Build, Execution, Deployment/Toolchains shows me this:

Use MinGW home: C:\MinGW
Use bundled CMake
Check Environment
  OK Environment. MinGW 4.0
  OK CMake 2.8.12.2 bundled
    OK Make: C:\MinGW\bin\mingw32-make.exe
    OK C Compiler: C:\MinGW\bin\gcc
    OK CXX Compiler: C:\MinGW\bin\g++.exe
  OK GDB: 7.8 bundled

But CMAKE_C_COMPILER contains C:/FPC/2.6.4/bin/i386-win32/gcc.exe. This gcc is from a working installation of Free Pascal. All other CMake variables contain the correct values. I have removed the C:/FPC/2.6.4/bin/i386-win32 directory from the PATH variable, but I still get an error message:

Error:The C compiler "C:/FPC/2.6.4/bin/i386-win32/gcc.exe" is not able to compile a simple test program.
...
CMake will not be able to correctly generate this project.

Does this mean, that I have to correct CMAKE_C_COMPILER in every project in the file CMakeLists.txt?

Thank you for helping me

Alexander

0
2 comments

Is this 'C:\MinGW\bin\gcc' an existing compiler?
Most likely this FPC compiler is found by the CMake itself. Try to remove FPC dir from system PATH variable. Does it help?

0

Hello,

I have deleted the old project and created a new one. I have moved the path settings for FPC from the beginning and inserted them at the end of the path. The new project worked from the beginning and without setting CMAKE_C_COMPILER and without changing options in the project.

Thanks for your help
Alexander

0

Please sign in to leave a comment.