CMake: Internally uses -S instead of -H to specify source directory

This commit is contained in:
Robert Maynard 2018-09-06 13:02:09 -04:00
parent a10d63d578
commit de962cc00d
6 changed files with 10 additions and 10 deletions

View File

@ -150,7 +150,7 @@ int main(int argc, char** argv)
typedef cmsys::CommandLineArguments argT;
arg.AddArgument("-B", argT::CONCAT_ARGUMENT, &binaryDirectory,
"Binary Directory");
arg.AddArgument("-H", argT::CONCAT_ARGUMENT, &sourceDirectory,
arg.AddArgument("-S", argT::CONCAT_ARGUMENT, &sourceDirectory,
"Source Directory");
// do not complain about unknown options
arg.StoreUnusedArguments(true);

View File

@ -2430,7 +2430,7 @@ void cmGlobalGenerator::AddGlobalTarget_EditCache(
std::string edit_cmd = this->GetEditCacheCommand();
if (!edit_cmd.empty()) {
singleLine.push_back(std::move(edit_cmd));
singleLine.push_back("-H$(CMAKE_SOURCE_DIR)");
singleLine.push_back("-S$(CMAKE_SOURCE_DIR)");
singleLine.push_back("-B$(CMAKE_BINARY_DIR)");
gti.Message = "Running CMake cache editor...";
gti.UsesTerminal = true;
@ -2460,7 +2460,7 @@ void cmGlobalGenerator::AddGlobalTarget_RebuildCache(
gti.UsesTerminal = true;
cmCustomCommandLine singleLine;
singleLine.push_back(cmSystemTools::GetCMakeCommand());
singleLine.push_back("-H$(CMAKE_SOURCE_DIR)");
singleLine.push_back("-S$(CMAKE_SOURCE_DIR)");
singleLine.push_back("-B$(CMAKE_BINARY_DIR)");
gti.CommandLines.push_back(std::move(singleLine));
targets.push_back(std::move(gti));

View File

@ -1340,7 +1340,7 @@ void cmGlobalNinjaGenerator::WriteTargetRebuildManifest(std::ostream& os)
std::ostringstream cmd;
cmd << lg->ConvertToOutputFormat(cmSystemTools::GetCMakeCommand(),
cmOutputConverter::SHELL)
<< " -H"
<< " -S"
<< lg->ConvertToOutputFormat(lg->GetSourceDirectory(),
cmOutputConverter::SHELL)
<< " -B"

View File

@ -177,9 +177,9 @@ bool cmGlobalVisualStudio8Generator::AddCheckTarget()
// Create a rule to re-run CMake.
cmCustomCommandLine commandLine;
commandLine.push_back(cmSystemTools::GetCMakeCommand());
std::string argH = "-H";
argH += lg->GetSourceDirectory();
commandLine.push_back(argH);
std::string argS = "-S";
argS += lg->GetSourceDirectory();
commandLine.push_back(argS);
std::string argB = "-B";
argB += lg->GetBinaryDirectory();
commandLine.push_back(argB);

View File

@ -773,7 +773,7 @@ void cmLocalUnixMakefileGenerator3::WriteSpecialTargetsBottom(
std::string cmakefileName = cmake::GetCMakeFilesDirectoryPostSlash();
cmakefileName += "Makefile.cmake";
std::string runRule =
"$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
"$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
runRule += " --check-build-system ";
runRule +=
this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL);
@ -1684,7 +1684,7 @@ void cmLocalUnixMakefileGenerator3::WriteLocalAllRules(
cmakefileName += "Makefile.cmake";
{
std::string runRule =
"$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
"$(CMAKE_COMMAND) -S$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR)";
runRule += " --check-build-system ";
runRule +=
this->ConvertToOutputFormat(cmakefileName, cmOutputConverter::SHELL);

View File

@ -260,7 +260,7 @@ cmSourceFile* cmLocalVisualStudio7Generator::CreateVCProjBuildRule()
std::string comment = "Building Custom Rule ";
comment += makefileIn;
std::string args;
args = "-H";
args = "-S";
args += this->GetSourceDirectory();
commandLine.push_back(args);
args = "-B";