summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalGenerator.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-11-12 13:44:08 (GMT)
committerBrad King <brad.king@kitware.com>2013-11-12 13:47:19 (GMT)
commit684063c0363687285126f30a517239aa2ad46149 (patch)
treec7bb4a0540da44dc14d1b8ab5de4b0102d925dd2 /Source/cmGlobalGenerator.cxx
parenteaf5b7a776e24af55f6f7f254171c3e2d2932d9b (diff)
downloadCMake-684063c0363687285126f30a517239aa2ad46149.zip
CMake-684063c0363687285126f30a517239aa2ad46149.tar.gz
CMake-684063c0363687285126f30a517239aa2ad46149.tar.bz2
Refactor tool selection for edit_cache (#14544)
Refactor edit_cache tool selection to ask each global generator for its preference. Teach the Ninja generator to always use cmake-gui because Ninja by design cannot run interactive terminal dialogs like ccmake. Teach the Makefile generator to use cmake-gui when also using an "extra" generator whose IDE has no terminal to run ccmake, and otherwise fall back to CMAKE_EDIT_COMMAND selection for normal Makefile build systems.
Diffstat (limited to 'Source/cmGlobalGenerator.cxx')
-rw-r--r--Source/cmGlobalGenerator.cxx15
1 files changed, 8 insertions, 7 deletions
diff --git a/Source/cmGlobalGenerator.cxx b/Source/cmGlobalGenerator.cxx
index 4ea5895..b2a0ef7 100644
--- a/Source/cmGlobalGenerator.cxx
+++ b/Source/cmGlobalGenerator.cxx
@@ -2158,11 +2158,11 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
singleLine.erase(singleLine.begin(), singleLine.end());
depends.erase(depends.begin(), depends.end());
- // Use CMAKE_EDIT_COMMAND for the edit_cache rule if it is defined.
- // Otherwise default to the interactive command-line interface.
- if(mf->GetDefinition("CMAKE_EDIT_COMMAND"))
+ // Use generator preference for the edit_cache rule if it is defined.
+ std::string edit_cmd = this->GetEditCacheCommand();
+ if (!edit_cmd.empty())
{
- singleLine.push_back(mf->GetDefinition("CMAKE_EDIT_COMMAND"));
+ singleLine.push_back(edit_cmd);
singleLine.push_back("-H$(CMAKE_SOURCE_DIR)");
singleLine.push_back("-B$(CMAKE_BINARY_DIR)");
cpackCommandLines.push_back(singleLine);
@@ -2174,13 +2174,14 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
else
{
singleLine.push_back(cmakeCommand);
- singleLine.push_back("-i");
- singleLine.push_back(".");
+ singleLine.push_back("-E");
+ singleLine.push_back("echo");
+ singleLine.push_back("No interactive CMake dialog available.");
cpackCommandLines.push_back(singleLine);
(*targets)[editCacheTargetName] =
this->CreateGlobalTarget(
editCacheTargetName,
- "Running interactive CMake command-line interface...",
+ "No interactive CMake dialog available...",
&cpackCommandLines, depends, 0);
}
}