cmSourceFilesRemoveCommand.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*=========================================================================
  2. Program: CMake - Cross-Platform Makefile Generator
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
  8. See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
  9. This software is distributed WITHOUT ANY WARRANTY; without even
  10. the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  11. PURPOSE. See the above copyright notices for more information.
  12. =========================================================================*/
  13. #ifndef cmSourceFilesRemoveCommand_h
  14. #define cmSourceFilesRemoveCommand_h
  15. #include "cmStandardIncludes.h"
  16. #include "cmCommand.h"
  17. /** \class cmSourceFilesRemoveCommand
  18. * \brief Remove source files from the build.
  19. *
  20. * cmSourceFilesRemoveCommand removes source files from the build.
  21. * The sourcefiles will be removed from the current library (if defined by the
  22. * LIBRARY(library) command. This command is primarily designed to allow
  23. * customization of builds where (for example) a certain source file is
  24. * failing to compile and the user wishes to edit it out conditionally.
  25. *
  26. * \sa cmSourceFilesRequireCommand
  27. */
  28. class cmSourceFilesRemoveCommand : public cmCommand
  29. {
  30. public:
  31. /**
  32. * This is a virtual constructor for the command.
  33. */
  34. virtual cmCommand* Clone()
  35. {
  36. return new cmSourceFilesRemoveCommand;
  37. }
  38. /**
  39. * This is called when the command is first encountered in
  40. * the CMakeLists.txt file.
  41. */
  42. virtual bool InitialPass(std::vector<std::string> const& args);
  43. /**
  44. * The name of the command as specified in CMakeList.txt.
  45. */
  46. virtual const char* GetName() { return "SOURCE_FILES_REMOVE";}
  47. /**
  48. * Succinct documentation.
  49. */
  50. virtual const char* GetTerseDocumentation()
  51. {
  52. return "Remove sources from those listed in the given variable.";
  53. }
  54. /**
  55. * Remove (conditionally if desired) a list of source files from a group.
  56. * This is most likely when the user has problems compiling certain files
  57. * in a library and wants to remove them (perhaps in an optional INCLUDE)
  58. */
  59. virtual const char* GetFullDocumentation()
  60. {
  61. return
  62. " SOURCE_FILES_REMOVE(variable file1 file2 ...)\n"
  63. "Removes the sources specified from the sources listed in the given "
  64. "variable.";
  65. }
  66. cmTypeMacro(cmSourceFilesRemoveCommand, cmCommand);
  67. };
  68. #endif