CMake changes CXX environment variable
Upon configuration, CMake appears to change the value of the environment variable that was set for CXX.
For the simple file below:
cmake_minimum_required( VERSION 3.0 )
project( cray_reproduce CXX )
message("ENV{CXX} : $ENV{CXX}")
when CXX is set to CC, upon first configuration, CMake changes the value to the full path of CC.
~/dev/cray_cxx/build> CXX=CC cmake ../
-- The CXX compiler identification is Intel 19.1.3.20200925
-- Cray Programming Environment 2.7.5 CXX
-- Check for working CXX compiler: /opt/cray/pe/craype/2.7.5/bin/CC
-- Check for working CXX compiler: /opt/cray/pe/craype/2.7.5/bin/CC -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
ENV{CXX} : /opt/cray/pe/craype/2.7.5/bin/CC
-- Configuring done
-- Generating done
-- Build files have been written to: ~/dev/cray_cxx/build
Edited by Brad King