[cmake-commits] alex committed cmUtilitySourceCommand.cxx 1.23 1.24
cmake-commits at cmake.org
cmake-commits at cmake.org
Fri Aug 10 15:02:40 EDT 2007
Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv22847
Modified Files:
cmUtilitySourceCommand.cxx
Log Message:
ENH: print a warning if UTILITY_SOURCE is used in cross compiling mode
-make it possible to preload the cache with the command in cross compiling
mode
Alex
Index: cmUtilitySourceCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmUtilitySourceCommand.cxx,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- cmUtilitySourceCommand.cxx 17 May 2007 17:20:44 -0000 1.23
+++ cmUtilitySourceCommand.cxx 10 Aug 2007 19:02:38 -0000 1.24
@@ -36,11 +36,31 @@
// CMAKE_CFG_INTDIR setting then the value is out of date.
const char* intDir =
this->Makefile->GetRequiredDefinition("CMAKE_CFG_INTDIR");
- if(cacheValue &&
+
+ bool haveCacheValue = false;
+ if (this->Makefile->IsOn("CMAKE_CROSSCOMPILING"))
+ {
+ haveCacheValue = (cacheValue != 0);
+ if (!haveCacheValue)
+ {
+ std::string msg = "UTILITY_SOURCE is used in cross compiling mode for ";
+ msg += cacheEntry;
+ msg += ". If your intention is to run this executable, you need to "
+ "preload the cache with the full path to a version of that "
+ "program, which runs on this build machine.";
+ cmSystemTools::Message(msg.c_str() ,"Warning");
+ }
+ }
+ else
+ {
+ haveCacheValue = (cacheValue &&
(strstr(cacheValue, "(IntDir)") == 0 ||
intDir && strcmp(intDir, "$(IntDir)") == 0) &&
(this->Makefile->GetCacheMajorVersion() != 0 &&
- this->Makefile->GetCacheMinorVersion() != 0 ))
+ this->Makefile->GetCacheMinorVersion() != 0 ));
+ }
+
+ if(haveCacheValue)
{
return true;
}
More information about the Cmake-commits
mailing list