cmSourceFilesRequireCommand.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*=========================================================================
  2. Program: Insight Segmentation & Registration Toolkit
  3. Module: $RCSfile$
  4. Language: C++
  5. Date: $Date$
  6. Version: $Revision$
  7. Copyright (c) 2000 National Library of Medicine
  8. All rights reserved.
  9. See COPYRIGHT.txt for copyright details.
  10. =========================================================================*/
  11. #ifndef cmSourceFilesRequireCommand_h
  12. #define cmSourceFilesRequireCommand_h
  13. #include "cmStandardIncludes.h"
  14. #include "cmCommand.h"
  15. /** \class cmSourceFilesRequireCommand
  16. * \brief Add additional sources to the build if certain required files
  17. * or CMake variables are defined.
  18. *
  19. * cmSourceFilesRequireCommand conditionally adds source files to the
  20. * build if the specified files of CMake variables are defined.
  21. * This command can be used to add source files that depend on external
  22. * packages or operating system features.
  23. */
  24. class cmSourceFilesRequireCommand : public cmCommand
  25. {
  26. public:
  27. /**
  28. * This is a virtual constructor for the command.
  29. */
  30. virtual cmCommand* Clone()
  31. {
  32. return new cmSourceFilesRequireCommand;
  33. }
  34. /**
  35. * This is called when the command is first encountered in
  36. * the CMakeLists.txt file.
  37. */
  38. virtual bool Invoke(std::vector<std::string>& args);
  39. /**
  40. * The name of the command as specified in CMakeList.txt.
  41. */
  42. virtual const char* GetName() { return "SOURCE_FILES_REQUIRE";}
  43. /**
  44. * Succinct documentation.
  45. */
  46. virtual const char* GetTerseDocumentation()
  47. {
  48. return "Add a list of source files if the required \n"
  49. "variables are set.";
  50. }
  51. /**
  52. * More documentation.
  53. */
  54. virtual const char* GetFullDocumentation()
  55. {
  56. return
  57. "SOURCE_FILES_REQUIRE(var1 var2 ... SOURCES_BEGIN file1 file2 ...)";
  58. }
  59. };
  60. #endif