COMP: Handle preinstall properly on IDEs
This commit is contained in:
parent
1ecd48ba67
commit
0ba40b59c7
@ -1289,7 +1289,10 @@ void cmGlobalGenerator::CreateDefaultGlobalTargets(cmTargets* targets)
|
|||||||
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
|
cpackCommandLines.erase(cpackCommandLines.begin(), cpackCommandLines.end());
|
||||||
singleLine.erase(singleLine.begin(), singleLine.end());
|
singleLine.erase(singleLine.begin(), singleLine.end());
|
||||||
depends.erase(depends.begin(), depends.end());
|
depends.erase(depends.begin(), depends.end());
|
||||||
depends.push_back("preinstall");
|
if ( this->GetPreInstallAvailable() )
|
||||||
|
{
|
||||||
|
depends.push_back("preinstall");
|
||||||
|
}
|
||||||
if(mf->GetDefinition("CMake_BINARY_DIR"))
|
if(mf->GetDefinition("CMake_BINARY_DIR"))
|
||||||
{
|
{
|
||||||
// We are building CMake itself. We cannot use the original
|
// We are building CMake itself. We cannot use the original
|
||||||
|
@ -174,6 +174,7 @@ protected:
|
|||||||
virtual const char* GetPackageTargetName() { return "PACKAGE"; }
|
virtual const char* GetPackageTargetName() { return "PACKAGE"; }
|
||||||
virtual const char* GetEditCacheTargetName() { return "EDIT_CACHE"; }
|
virtual const char* GetEditCacheTargetName() { return "EDIT_CACHE"; }
|
||||||
virtual const char* GetRebuildCacheTargetName() { return "REBUILD_CACHE"; }
|
virtual const char* GetRebuildCacheTargetName() { return "REBUILD_CACHE"; }
|
||||||
|
virtual bool GetPreInstallAvailable() { return false; }
|
||||||
|
|
||||||
bool m_ForceUnixPaths;
|
bool m_ForceUnixPaths;
|
||||||
cmStdString m_FindMakeProgramFile;
|
cmStdString m_FindMakeProgramFile;
|
||||||
|
@ -126,6 +126,7 @@ protected:
|
|||||||
virtual const char* GetPackageTargetName() { return "package"; }
|
virtual const char* GetPackageTargetName() { return "package"; }
|
||||||
virtual const char* GetEditCacheTargetName() { return "edit_cache"; }
|
virtual const char* GetEditCacheTargetName() { return "edit_cache"; }
|
||||||
virtual const char* GetRebuildCacheTargetName() { return "rebuild_cache"; }
|
virtual const char* GetRebuildCacheTargetName() { return "rebuild_cache"; }
|
||||||
|
virtual bool GetPreInstallAvailable() { return true; }
|
||||||
|
|
||||||
|
|
||||||
// Some make programs (Borland) do not keep a rule if there are no
|
// Some make programs (Borland) do not keep a rule if there are no
|
||||||
|
@ -59,7 +59,6 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
bool doneEditCache = false;
|
bool doneEditCache = false;
|
||||||
bool doneRebuildCache = false;
|
bool doneRebuildCache = false;
|
||||||
bool donePackage = false;
|
bool donePackage = false;
|
||||||
bool donePreInstall = false;
|
|
||||||
|
|
||||||
// For each cmMakefile, create a VCProj for it, and
|
// For each cmMakefile, create a VCProj for it, and
|
||||||
// add it to this SLN file
|
// add it to this SLN file
|
||||||
@ -169,17 +168,6 @@ void cmGlobalVisualStudio71Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
doneInstall = true;
|
doneInstall = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(l->first == "preinstall")
|
|
||||||
{
|
|
||||||
if(donePreInstall)
|
|
||||||
{
|
|
||||||
skip = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
donePreInstall = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(l->first == "RUN_TESTS")
|
if(l->first == "RUN_TESTS")
|
||||||
{
|
{
|
||||||
if(doneRunTests)
|
if(doneRunTests)
|
||||||
|
@ -210,11 +210,6 @@ void cmGlobalVisualStudio7Generator::Generate()
|
|||||||
no_working_dir,
|
no_working_dir,
|
||||||
cmake_command.c_str(),
|
cmake_command.c_str(),
|
||||||
"-DBUILD_TYPE=$(OutDir)", "-P", "cmake_install.cmake");
|
"-DBUILD_TYPE=$(OutDir)", "-P", "cmake_install.cmake");
|
||||||
gen[0]->GetMakefile()->
|
|
||||||
AddUtilityCommand("preinstall", false, no_output, no_depends,
|
|
||||||
no_working_dir,
|
|
||||||
cmake_command.c_str(),
|
|
||||||
"-E", "echo", "preinstall");
|
|
||||||
|
|
||||||
// Make the INSTALL target depend on ALL_BUILD unless the
|
// Make the INSTALL target depend on ALL_BUILD unless the
|
||||||
// project says to not do so.
|
// project says to not do so.
|
||||||
@ -288,7 +283,6 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
bool doneEditCache = false;
|
bool doneEditCache = false;
|
||||||
bool doneRebuildCache = false;
|
bool doneRebuildCache = false;
|
||||||
bool donePackage = false;
|
bool donePackage = false;
|
||||||
bool donePreInstall = false;
|
|
||||||
|
|
||||||
// For each cmMakefile, create a VCProj for it, and
|
// For each cmMakefile, create a VCProj for it, and
|
||||||
// add it to this SLN file
|
// add it to this SLN file
|
||||||
@ -387,17 +381,6 @@ void cmGlobalVisualStudio7Generator::WriteSLNFile(std::ostream& fout,
|
|||||||
doneInstall = true;
|
doneInstall = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(l->first == "preinstall")
|
|
||||||
{
|
|
||||||
if(donePreInstall)
|
|
||||||
{
|
|
||||||
skip = true;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
donePreInstall = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(l->first == "RUN_TESTS")
|
if(l->first == "RUN_TESTS")
|
||||||
{
|
{
|
||||||
if(doneRunTests)
|
if(doneRunTests)
|
||||||
@ -760,7 +743,6 @@ void cmGlobalVisualStudio7Generator::Configure()
|
|||||||
cmGlobalGenerator::Configure();
|
cmGlobalGenerator::Configure();
|
||||||
this->CreateGUID("ALL_BUILD");
|
this->CreateGUID("ALL_BUILD");
|
||||||
this->CreateGUID("INSTALL");
|
this->CreateGUID("INSTALL");
|
||||||
this->CreateGUID("preinstall");
|
|
||||||
this->CreateGUID("RUN_TESTS");
|
this->CreateGUID("RUN_TESTS");
|
||||||
this->CreateGUID("EDIT_CACHE");
|
this->CreateGUID("EDIT_CACHE");
|
||||||
this->CreateGUID("REBUILD_CACHE");
|
this->CreateGUID("REBUILD_CACHE");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user