Loading Cmake project...

version 1.0.3. Windows 8.1/cygwinSits there "loading" forvever.

works without this line in the Cmake file:

set(CMAKE_CXX_COMPILER           "/usr/bin/clang.exe")

worked with 1.0.2. invalidate caches & restart no change.

2 comments
Comment actions Permalink

Hi!

Please don't change the value of the CMAKE_CXX_COMPILER command manually. It's highly not recommended.

For changing compiler please try to use method #2 from http://www.cmake.org/Wiki/CMake_FAQ#How_do_I_use_a_different_compiler.3F pass

-D CMAKE_C_COMPILER=<your_path_to_c_compiler>  -D CMAKE_CXX_COMPILER=<your_path_to_cxx_compiler>
to Preferences (Settings) | Build, Execution, Deployment | CMake | CMake options.
Then corresponding CMake cache variables will be overwritten respectively.
0
Comment actions Permalink

im looking to have an easy way to switch between GCC and Clang.

The idea is to set the variables in the makefile, along these lines:

if(USE_CLANG)
  set(CMAKE_C_COMPILER             "/usr/bin/clang.exe")
  set(CMAKE_CXX_COMPILER           "/usr/bin/clang.exe")
  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --stdlib=libstdc++ -Wno-parentheses")
endif(USE_CLANG)

Eventually, there'll be a lot of different options between the compilers and too clumsy for the command line.

am i missing an easy way to do this?

thanks.

0

Please sign in to leave a comment.