From ac8232e140fdc934cff8895f5cca80fb8ab4d49f Mon Sep 17 00:00:00 2001 From: Andy Cedilnik Date: Wed, 21 Apr 2004 11:32:27 -0400 Subject: [PATCH] ENH: Do preinstall and postinstall script even if the target is not installed --- Source/cmLocalGenerator.cxx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index c27e6af22..5e9c25aea 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -132,6 +132,12 @@ void cmLocalGenerator::GenerateInstallRules() for(cmTargets::const_iterator l = tgts.begin(); l != tgts.end(); l++) { + const char* preinstall = l->second.GetProperty("PRE_INSTALL_SCRIPT"); + const char* postinstall = l->second.GetProperty("POST_INSTALL_SCRIPT"); + if ( preinstall ) + { + fout << "INCLUDE(\"" << preinstall << "\")" << std::endl; + } if (l->second.GetInstallPath() != "") { destination = prefix + l->second.GetInstallPath(); @@ -139,12 +145,6 @@ void cmLocalGenerator::GenerateInstallRules() const char* dest = destination.c_str(); int type = l->second.GetType(); - const char* preinstall = l->second.GetProperty("PRE_INSTALL_SCRIPT"); - const char* postinstall = l->second.GetProperty("POST_INSTALL_SCRIPT"); - if ( preinstall ) - { - fout << "INCLUDE(\"" << preinstall << "\")" << std::endl; - } std::string fname; const char* files; @@ -242,10 +242,10 @@ void cmLocalGenerator::GenerateInstallRules() default: break; } - if ( postinstall ) - { - fout << "INCLUDE(\"" << postinstall << "\")" << std::endl; - } + } + if ( postinstall ) + { + fout << "INCLUDE(\"" << postinstall << "\")" << std::endl; } } cmMakefile* mf = this->GetMakefile();