summaryrefslogtreecommitdiff
path: root/Source/cmUnixMakefileGenerator.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmUnixMakefileGenerator.cxx')
-rw-r--r--Source/cmUnixMakefileGenerator.cxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/Source/cmUnixMakefileGenerator.cxx b/Source/cmUnixMakefileGenerator.cxx
index 209765bf10..8b93f11b22 100644
--- a/Source/cmUnixMakefileGenerator.cxx
+++ b/Source/cmUnixMakefileGenerator.cxx
@@ -1370,6 +1370,16 @@ void cmUnixMakefileGenerator::ComputeSystemInfo()
{
if (m_CacheOnly)
{
+ if(m_Makefile->GetDefinition("CMAKE_CXX_COMPILER"))
+ {
+ std::string env = "CXX=${CMAKE_CXX_COMPILER}";
+ m_Makefile->ExpandVariablesInString(env);
+ putenv(env.c_str());
+ env = "CC=${CMAKE_C_COMPILER}";
+ m_Makefile->ExpandVariablesInString(env);
+ putenv(env.c_str());
+ }
+
// currently we run configure shell script here to determine the info
std::string output;
std::string cmd = "cd ";