From 99f3b37f9c513c85063a85608c2737ee51a3eb36 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 27 Jul 2005 16:37:44 -0400 Subject: [PATCH] BUG: Hack to support building existing trees with UTILITY_SOURCE commands and the new VS generator directory structure. --- Source/cmUtilitySourceCommand.cxx | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx index 3f5d13dac..425637fda 100644 --- a/Source/cmUtilitySourceCommand.cxx +++ b/Source/cmUtilitySourceCommand.cxx @@ -31,11 +31,15 @@ bool cmUtilitySourceCommand::InitialPass(std::vector 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; }