diff options
author | Brad King <brad.king@kitware.com> | 2006-04-13 02:04:50 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-04-13 02:04:50 (GMT) |
commit | d4c5fe840beb029cb60572cabd643feb4e239830 (patch) | |
tree | 3bc37efec89d6bf17f6c5cd1efef91d236744031 /Source/cmInstallCommand.cxx | |
parent | 58641b2ceb5d3401e1cb0e4bb897a9fe2329e525 (diff) | |
download | CMake-d4c5fe840beb029cb60572cabd643feb4e239830.zip CMake-d4c5fe840beb029cb60572cabd643feb4e239830.tar.gz CMake-d4c5fe840beb029cb60572cabd643feb4e239830.tar.bz2 |
ENH: Added INSTALL(CODE) mode to allow inline specification of install script code. This reduces the need for configuring an install script that needs some variable settings because the install code can set thing up first.
Diffstat (limited to 'Source/cmInstallCommand.cxx')
-rw-r--r-- | Source/cmInstallCommand.cxx | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx index f51fb28..0669b7f 100644 --- a/Source/cmInstallCommand.cxx +++ b/Source/cmInstallCommand.cxx @@ -35,6 +35,10 @@ bool cmInstallCommand::InitialPass(std::vector<std::string> const& args) { return this->HandleScriptMode(args); } + else if(args[0] == "CODE") + { + return this->HandleScriptMode(args); + } else if(args[0] == "TARGETS") { return this->HandleTargetsMode(args); @@ -59,11 +63,18 @@ bool cmInstallCommand::InitialPass(std::vector<std::string> const& args) bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args) { bool doing_script = false; + bool doing_code = false; for(size_t i=0; i < args.size(); ++i) { if(args[i] == "SCRIPT") { doing_script = true; + doing_code = false; + } + else if(args[i] == "CODE") + { + doing_script = false; + doing_code = true; } else if(doing_script) { @@ -83,12 +94,24 @@ bool cmInstallCommand::HandleScriptMode(std::vector<std::string> const& args) this->Makefile->AddInstallGenerator( new cmInstallScriptGenerator(script.c_str())); } + else if(doing_code) + { + doing_code = false; + std::string code = args[i]; + this->Makefile->AddInstallGenerator( + new cmInstallScriptGenerator(code.c_str(), true)); + } } if(doing_script) { this->SetError("given no value for SCRIPT argument."); return false; } + if(doing_code) + { + this->SetError("given no value for CODE argument."); + return false; + } return true; } |