diff options
-rw-r--r-- | Source/cmUtilitySourceCommand.cxx | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 3f5d13d..425637f 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -31,11 +31,15 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string> const& args) std::string cacheEntry = *arg++; const char* cacheValue = m_Makefile->GetDefinition(cacheEntry.c_str()); - // If it exists already, we are done. - // unless this is Major - if(cacheValue && - (m_Makefile->GetCacheMajorVersion() != 0 - && m_Makefile->GetCacheMinorVersion() != 0 )) + // If it exists already and appears up to date then we are done. If + // the string contains "(IntDir)" but that is not the + // CMAKE_CFG_INTDIR setting then the value is out of date. + const char* intDir = m_Makefile->GetRequiredDefinition("CMAKE_CFG_INTDIR"); + if(cacheValue && + (strstr(cacheValue, "(IntDir)") == 0 || + intDir && strcmp(intDir, "$(IntDir)") == 0) && + (m_Makefile->GetCacheMajorVersion() != 0 && + m_Makefile->GetCacheMinorVersion() != 0 )) { return true; } |