|
|
@@ -756,20 +756,39 @@ int cmake::AddCMakePaths()
|
|
|
this->CacheManager->AddCacheEntry
|
|
|
("CMAKE_COMMAND",cMakeSelf.c_str(), "Path to CMake executable.",
|
|
|
cmCacheManager::INTERNAL);
|
|
|
-
|
|
|
- // Find and save the command to edit the cache
|
|
|
- std::string editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
|
|
|
- "/ccmake" + cmSystemTools::GetFilenameExtension(cMakeSelf);
|
|
|
- if( !cmSystemTools::FileExists(editCacheCommand.c_str()))
|
|
|
- {
|
|
|
- editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
|
|
|
- "/CMakeSetup" + cmSystemTools::GetFilenameExtension(cMakeSelf);
|
|
|
- }
|
|
|
- if(cmSystemTools::FileExists(editCacheCommand.c_str()))
|
|
|
+ // if the edit command is not yet in the cache,
|
|
|
+ // or if CMakeEditCommand has been set on this object,
|
|
|
+ // then set the CMAKE_EDIT_COMMAND in the cache
|
|
|
+ // This will mean that the last gui to edit the cache
|
|
|
+ // will be the one that make edit_cache uses.
|
|
|
+ if(!this->GetCacheDefinition("CMAKE_EDIT_COMMAND")
|
|
|
+ || !this->CMakeEditCommand.empty())
|
|
|
{
|
|
|
- this->CacheManager->AddCacheEntry
|
|
|
- ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(),
|
|
|
- "Path to cache edit program executable.", cmCacheManager::INTERNAL);
|
|
|
+ // Find and save the command to edit the cache
|
|
|
+ std::string editCacheCommand;
|
|
|
+ if(!this->CMakeEditCommand.empty())
|
|
|
+ {
|
|
|
+ editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf)
|
|
|
+ + std::string("/")
|
|
|
+ + this->CMakeEditCommand
|
|
|
+ + cmSystemTools::GetFilenameExtension(cMakeSelf);
|
|
|
+ }
|
|
|
+ if( !cmSystemTools::FileExists(editCacheCommand.c_str()))
|
|
|
+ {
|
|
|
+ editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
|
|
|
+ "/ccmake" + cmSystemTools::GetFilenameExtension(cMakeSelf);
|
|
|
+ }
|
|
|
+ if( !cmSystemTools::FileExists(editCacheCommand.c_str()))
|
|
|
+ {
|
|
|
+ editCacheCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
|
|
|
+ "/CMakeSetup" + cmSystemTools::GetFilenameExtension(cMakeSelf);
|
|
|
+ }
|
|
|
+ if(cmSystemTools::FileExists(editCacheCommand.c_str()))
|
|
|
+ {
|
|
|
+ this->CacheManager->AddCacheEntry
|
|
|
+ ("CMAKE_EDIT_COMMAND", editCacheCommand.c_str(),
|
|
|
+ "Path to cache edit program executable.", cmCacheManager::INTERNAL);
|
|
|
+ }
|
|
|
}
|
|
|
std::string ctestCommand = cmSystemTools::GetFilenamePath(cMakeSelf) +
|
|
|
"/ctest" + cmSystemTools::GetFilenameExtension(cMakeSelf);
|