4 comments
Comment actions Permalink

Oleg, to access environment variables in CMake, you need to use $ENV{NAME} syntax. Here are some details.

0
Comment actions Permalink

Ok, but why CMAKE_C_COMPILER not set to clang?

0
Comment actions Permalink

CMake does some introspection and selects an appropriate compiler on it's own.
After project is first generated, environment variables do not affect the selected compiler.

To force the specific comiler you can either pass -D CMAKE_*_COMPILER as CMake options, or clean generated CMake folder (Help | Show Generated CMake Files...) and press Reload Project on CMake tool window - it should pick up CC, CXX variables.

0

Please sign in to leave a comment.