diff options
author | Bill Hoffman <bill.hoffman@kitware.com> | 2008-04-01 21:51:10 (GMT) |
---|---|---|
committer | Bill Hoffman <bill.hoffman@kitware.com> | 2008-04-01 21:51:10 (GMT) |
commit | 2efad09d923380817eb62d6f9a56eb44f141ea21 (patch) | |
tree | f7ebd5dd43106d53e3af1cf8f326cc394f2baa7a /Source/CPack/cmCPackDebGenerator.cxx | |
parent | 2488dccf4e2ab4f68a55e5caa4e55961266614e2 (diff) | |
download | CMake-2efad09d923380817eb62d6f9a56eb44f141ea21.zip CMake-2efad09d923380817eb62d6f9a56eb44f141ea21.tar.gz CMake-2efad09d923380817eb62d6f9a56eb44f141ea21.tar.bz2 |
ENH: add CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA variable
Diffstat (limited to 'Source/CPack/cmCPackDebGenerator.cxx')
-rw-r--r-- | Source/CPack/cmCPackDebGenerator.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Source/CPack/cmCPackDebGenerator.cxx b/Source/CPack/cmCPackDebGenerator.cxx index b0ade56..6c0b46a 100644 --- a/Source/CPack/cmCPackDebGenerator.cxx +++ b/Source/CPack/cmCPackDebGenerator.cxx @@ -200,6 +200,30 @@ int cmCPackDebGenerator::CompressFiles(const char* outFileName, cmd = "\""; cmd += cmakeExecutable; cmd += "\" -E tar cfz control.tar.gz ./control ./md5sums"; + const char* controlExtra = + this->GetOption("CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA"); + if( controlExtra ) + { + std::vector<std::string> controlExtraList; + cmSystemTools::ExpandListArgument(controlExtra, controlExtraList); + for(std::vector<std::string>::iterator i = + controlExtraList.begin(); i != controlExtraList.end(); ++i) + { + std::string filenamename = + cmsys::SystemTools::GetFilenameName(i->c_str()); + std::string localcopy = toplevel; + localcopy += "/"; + localcopy += filenamename; + // if we can copy the file, it means it does exist, let's add it: + if( cmsys::SystemTools::CopyFileIfDifferent( + i->c_str(), localcopy.c_str()) ) + { + // debian is picky and need relative to ./ path in the tar.gz + cmd += " ./"; + cmd += filenamename; + } + } + } res = cmSystemTools::RunSingleCommand(cmd.c_str(), &output, &retVal, toplevel, this->GeneratorVerbose, 0); |