Commit 3d9610fe authored by Andy Cedilnik's avatar Andy Cedilnik
Browse files

COMP: More fixes for non makefile generators and global targets

parent 1cd8c643
......@@ -1248,11 +1248,13 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
singleLine.erase(singleLine.begin(), singleLine.end());
depends.erase(depends.begin(), depends.end());
const char* cmakeCommand = this->GetCMakeInstance()->GetCMakeCommand();
// 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"))
{
singleLine.push_back("$(CMAKE_EDIT_COMMAND)");
singleLine.push_back(mf->GetDefinition("CMAKE_EDIT_COMMAND"));
singleLine.push_back("-H$(CMAKE_SOURCE_DIR)");
singleLine.push_back("-B$(CMAKE_BINARY_DIR)");
cpackCommandLines.push_back(singleLine);
......@@ -1263,7 +1265,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
}
else
{
singleLine.push_back("$(CMAKE_COMMAND)");
singleLine.push_back(cmakeCommand);
singleLine.push_back("-H$(CMAKE_SOURCE_DIR)");
singleLine.push_back("-B$(CMAKE_BINARY_DIR)");
singleLine.push_back("-i");
......@@ -1278,7 +1280,7 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
singleLine.erase(singleLine.begin(), singleLine.end());
depends.erase(depends.begin(), depends.end());
singleLine.push_back("$(CMAKE_COMMAND)");
singleLine.push_back(cmakeCommand);
singleLine.push_back("-H$(CMAKE_SOURCE_DIR)");
singleLine.push_back("-B$(CMAKE_BINARY_DIR)");
cpackCommandLines.push_back(singleLine);
......@@ -1301,12 +1303,11 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
// We are building CMake itself. We cannot use the original
// executable to install over itself.
cmd = mf->GetDefinition("EXECUTABLE_OUTPUT_PATH");
cmd += "/";
cmd += "cmake";
cmd += "/cmake";
}
else
{
cmd = "$(CMAKE_COMMAND)";
cmd = cmakeCommand;
}
singleLine.push_back(cmd.c_str());
const char* cmakeCfgIntDir = this->GetCMakeCFGInitDirectory();
......
......@@ -273,6 +273,7 @@ class cmake
*/
const char* GetCTestCommand();
const char* GetCPackCommand();
const char* GetCMakeCommand() { return m_CMakeCommand.c_str(); }
protected:
typedef cmGlobalGenerator* (*CreateGeneratorFunctionType)();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment