cmSourceFilesRemoveCommand.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  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 "cmCommand.h"
  16. /** \class cmSourceFilesRemoveCommand
  17. * \brief Remove source files from the build.
  18. *
  19. * cmSourceFilesRemoveCommand removes source files from the build.
  20. * The sourcefiles will be removed from the current library (if defined by the
  21. * LIBRARY(library) command. This command is primarily designed to allow
  22. * customization of builds where (for example) a certain source file is
  23. * failing to compile and the user wishes to edit it out conditionally.
  24. *
  25. * \sa cmSourceFilesRequireCommand
  26. */
  27. class cmSourceFilesRemoveCommand : public cmCommand
  28. {
  29. public:
  30. /**
  31. * This is a virtual constructor for the command.
  32. */
  33. virtual cmCommand* Clone()
  34. {
  35. return new cmSourceFilesRemoveCommand;
  36. }
  37. /**
  38. * This is called when the command is first encountered in
  39. * the CMakeLists.txt file.
  40. */
  41. virtual bool InitialPass(std::vector<std::string> const& args);
  42. /**
  43. * The name of the command as specified in CMakeList.txt.
  44. */
  45. virtual const char* GetName() { return "SOURCE_FILES_REMOVE";}
  46. /**
  47. * Succinct documentation.
  48. */
  49. virtual const char* GetTerseDocumentation()
  50. {
  51. return "Remove sources from those listed in the given variable.";
  52. }
  53. /**
  54. * Remove (conditionally if desired) a list of source files from a group.
  55. * This is most likely when the user has problems compiling certain files
  56. * in a library and wants to remove them (perhaps in an optional INCLUDE)
  57. */
  58. virtual const char* GetFullDocumentation()
  59. {
  60. return
  61. " SOURCE_FILES_REMOVE(variable file1 file2 ...)\n"
  62. "Removes the sources specified from the sources listed in the given "
  63. "variable.";
  64. }
  65. cmTypeMacro(cmSourceFilesRemoveCommand, cmCommand);
  66. };
  67. #endif