summaryrefslogtreecommitdiffstats
path: root/Source/cmUtilitySourceCommand.cxx
diff options
context:
space:
mode:
authorAlexander Neundorf <neundorf@kde.org>2007-08-10 19:02:38 (GMT)
committerAlexander Neundorf <neundorf@kde.org>2007-08-10 19:02:38 (GMT)
commita793daf22887d13744ea2f3a26ed025562aaa162 (patch)
treea49b5a23baa76ea206a3a640495ede288b077472 /Source/cmUtilitySourceCommand.cxx
parent578841cce53d476afdb646ed7db29f3752ac9786 (diff)
downloadCMake-a793daf22887d13744ea2f3a26ed025562aaa162.zip
CMake-a793daf22887d13744ea2f3a26ed025562aaa162.tar.gz
CMake-a793daf22887d13744ea2f3a26ed025562aaa162.tar.bz2
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
Diffstat (limited to 'Source/cmUtilitySourceCommand.cxx')
-rw-r--r--Source/cmUtilitySourceCommand.cxx24
1 files changed, 22 insertions, 2 deletions
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index 8b7a3e2..8485bfd 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -36,11 +36,31 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args)
// 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;
}