summaryrefslogtreecommitdiff
path: root/Source/cmUtilitySourceCommand.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmUtilitySourceCommand.cxx')
-rw-r--r--Source/cmUtilitySourceCommand.cxx17
1 files changed, 11 insertions, 6 deletions
diff --git a/Source/cmUtilitySourceCommand.cxx b/Source/cmUtilitySourceCommand.cxx
index 32506d08a8..0cb83ddb3c 100644
--- a/Source/cmUtilitySourceCommand.cxx
+++ b/Source/cmUtilitySourceCommand.cxx
@@ -60,13 +60,18 @@ bool cmUtilitySourceCommand::Invoke(std::vector<std::string>& args)
{ return true; }
}
- // The source exists. Construct the cache entry for the executable's
- // location.
+ // The source exists.
std::string cmakeCFGout = m_Makefile->GetDefinition("CMAKE_CFG_OUTDIR");
- std::string utilityExecutable = m_Makefile->GetCurrentOutputDirectory();
- utilityExecutable =
- (utilityExecutable+"/"+relativeSource+"/"+cmakeCFGout+"/"
- +utilityName+cmSystemTools::GetExecutableExtension());
+ std::string utilityDirectory = m_Makefile->GetCurrentOutputDirectory();
+ utilityDirectory += "/"+relativeSource;
+
+ // Tell the makefile where to look for this utility.
+ m_Makefile->AddUtilityDirectory(utilityDirectory.c_str());
+
+ // Construct the cache entry for the executable's location.
+ std::string utilityExecutable =
+ utilityDirectory+"/"+cmakeCFGout+"/"
+ +utilityName+cmSystemTools::GetExecutableExtension();
// Enter the value into the cache.
cmCacheManager::GetInstance()->AddCacheEntry(cacheEntry.c_str(),