summaryrefslogtreecommitdiff
path: root/Source/cmUtilitySourceCommand.cxx
diff options
context:
space:
mode:
authorBill Hoffman <bill.hoffman@kitware.com>2001-06-07 14:52:29 -0400
committerBill Hoffman <bill.hoffman@kitware.com>2001-06-07 14:52:29 -0400
commit4f77d737c9d2ee681e17f5a672e18e85164550f1 (patch)
tree3fdcdaeac75422a958ff4e288adeafaf15de0ecf /Source/cmUtilitySourceCommand.cxx
parent5b4a11af80d27649ef191f918e92c3e41779e987 (diff)
downloadcmake-4f77d737c9d2ee681e17f5a672e18e85164550f1.tar.gz
ENH: move utilities to targets from makefile, and add versioning to cache
Diffstat (limited to 'Source/cmUtilitySourceCommand.cxx')
-rw-r--r--Source/cmUtilitySourceCommand.cxx31
1 files changed, 25 insertions, 6 deletions
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index 767b78d88c..fb9769455b 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -56,7 +56,10 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string>& args)
const char* cacheValue =
cmCacheManager::GetInstance()->GetCacheValue(cacheEntry.c_str());
// If it exists already, we are done.
- if(cacheValue)
+ // unless this is Major
+ if(cacheValue &&
+ (m_Makefile->GetCacheMajorVersion() != 0
+ && m_Makefile->GetCacheMinorVersion() != 0 ))
{
// Set the makefile's definition with the cache value.
m_Makefile->AddDefinition(cacheEntry.c_str(), cacheValue);
@@ -86,12 +89,21 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string>& args)
}
// The source exists.
- std::string cmakeCFGout = m_Makefile->GetDefinition("CMAKE_CFG_OUTDIR");
+ std::string cmakeCFGout = m_Makefile->GetDefinition("CMAKE_CFG_INTDIR");
std::string utilityDirectory = m_Makefile->GetCurrentOutputDirectory();
- utilityDirectory += "/"+relativeSource;
-
- // Tell the makefile where to look for this utility.
- m_Makefile->AddUtilityDirectory(utilityDirectory.c_str());
+ std::string exePath;
+ if (m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH"))
+ {
+ exePath = m_Makefile->GetDefinition("EXECUTABLE_OUTPUT_PATH");
+ }
+ if(exePath.size())
+ {
+ utilityDirectory = exePath;
+ }
+ else
+ {
+ utilityDirectory += "/"+relativeSource;
+ }
// Construct the cache entry for the executable's location.
std::string utilityExecutable =
@@ -103,6 +115,13 @@ bool cmUtilitySourceCommand::InitialPass(std::vector<std::string>& args)
utilityExecutable.c_str(),
"Path to an internal program.",
cmCacheManager::FILEPATH);
+ // add a value into the cache that maps from the
+ // full path to the name of the project
+ cmSystemTools::ConvertToUnixSlashes(utilityExecutable);
+ cmCacheManager::GetInstance()->AddCacheEntry(utilityExecutable.c_str(),
+ utilityName.c_str(),
+ "Executable to project name.",
+ cmCacheManager::INTERNAL);
// Set the definition in the makefile.
m_Makefile->AddDefinition(cacheEntry.c_str(), utilityExecutable.c_str());