cmGeneratorTarget.h 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /*============================================================================
  2. CMake - Cross Platform Makefile Generator
  3. Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
  4. Distributed under the OSI-approved BSD License (the "License");
  5. see accompanying file Copyright.txt for details.
  6. This software is distributed WITHOUT ANY WARRANTY; without even the
  7. implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  8. See the License for more information.
  9. ============================================================================*/
  10. #ifndef cmGeneratorTarget_h
  11. #define cmGeneratorTarget_h
  12. #include "cmStandardIncludes.h"
  13. class cmComputeLinkInformation;
  14. class cmCustomCommand;
  15. class cmGlobalGenerator;
  16. class cmLocalGenerator;
  17. class cmMakefile;
  18. class cmSourceFile;
  19. class cmTarget;
  20. class cmGeneratorTarget
  21. {
  22. public:
  23. cmGeneratorTarget(cmTarget*);
  24. ~cmGeneratorTarget();
  25. int GetType() const;
  26. const char *GetName() const;
  27. const char *GetProperty(const char *prop);
  28. bool GetPropertyAsBool(const char *prop);
  29. std::vector<cmSourceFile*> const& GetSourceFiles();
  30. cmTarget* Target;
  31. cmMakefile* Makefile;
  32. cmLocalGenerator* LocalGenerator;
  33. cmGlobalGenerator* GlobalGenerator;
  34. /** Sources classified by purpose. */
  35. std::vector<cmSourceFile*> CustomCommands;
  36. std::vector<cmSourceFile*> ExtraSources;
  37. std::vector<cmSourceFile*> HeaderSources;
  38. std::vector<cmSourceFile*> ObjectSources;
  39. std::vector<cmSourceFile*> ExternalObjects;
  40. std::vector<cmSourceFile*> IDLSources;
  41. std::string ModuleDefinitionFile;
  42. std::map<cmSourceFile const*, std::string> Objects;
  43. std::set<cmSourceFile const*> ExplicitObjectName;
  44. /** Full path with trailing slash to the top-level directory
  45. holding object files for this target. Includes the build
  46. time config name placeholder if needed for the generator. */
  47. std::string ObjectDirectory;
  48. std::vector<cmTarget*> ObjectLibraries;
  49. void UseObjectLibraries(std::vector<std::string>& objs);
  50. std::map<cmStdString, cmComputeLinkInformation*> LinkInformation;
  51. cmComputeLinkInformation* GetLinkInformation(const char* config);
  52. void GetAppleArchs(const char* config,
  53. std::vector<std::string>& archVec);
  54. ///! Return the rule variable used to create this type of target,
  55. // need to add CMAKE_(LANG) for full name.
  56. const char* GetCreateRuleVariable();
  57. /** Get the include directories for this target. */
  58. std::vector<std::string> GetIncludeDirectories();
  59. const char *GetCompileDefinitions(const char *config = 0);
  60. private:
  61. void ClassifySources();
  62. void LookupObjectLibraries();
  63. cmGeneratorTarget(cmGeneratorTarget const&);
  64. void operator=(cmGeneratorTarget const&);
  65. };
  66. typedef std::map<cmTarget*, cmGeneratorTarget*> cmGeneratorTargetsType;
  67. #endif