diff options
author | Alexander Neundorf <neundorf@kde.org> | 2007-08-10 19:02:38 (GMT) |
---|---|---|
committer | Alexander Neundorf <neundorf@kde.org> | 2007-08-10 19:02:38 (GMT) |
commit | a793daf22887d13744ea2f3a26ed025562aaa162 (patch) | |
tree | a49b5a23baa76ea206a3a640495ede288b077472 /Source/cmUtilitySourceCommand.cxx | |
parent | 578841cce53d476afdb646ed7db29f3752ac9786 (diff) | |
download | CMake-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.cxx | 24 |
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; } |