Explorar o código

BUG: set CXX and CC when running configure from cmake

Bill Hoffman %!s(int64=24) %!d(string=hai) anos
pai
achega
152fccf848
Modificáronse 1 ficheiros con 10 adicións e 0 borrados
  1. 10 0
      Source/cmUnixMakefileGenerator.cxx

+ 10 - 0
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 ";