2012-03-07 20:44:48 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2012 Kitware, Inc., Insight Software Consortium
|
|
|
|
|
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even the
|
|
|
|
implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
See the License for more information.
|
|
|
|
============================================================================*/
|
|
|
|
#ifndef cmGeneratorTarget_h
|
|
|
|
#define cmGeneratorTarget_h
|
|
|
|
|
|
|
|
#include "cmStandardIncludes.h"
|
|
|
|
|
|
|
|
class cmCustomCommand;
|
|
|
|
class cmGlobalGenerator;
|
|
|
|
class cmLocalGenerator;
|
|
|
|
class cmMakefile;
|
|
|
|
class cmSourceFile;
|
|
|
|
class cmTarget;
|
|
|
|
|
|
|
|
class cmGeneratorTarget
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
cmGeneratorTarget(cmTarget*);
|
|
|
|
|
2012-09-17 14:02:24 +04:00
|
|
|
int GetType() const;
|
|
|
|
const char *GetName() const;
|
2013-11-03 17:10:12 +04:00
|
|
|
const char *GetProperty(const char *prop) const;
|
|
|
|
bool GetPropertyAsBool(const char *prop) const;
|
|
|
|
std::vector<cmSourceFile*> const& GetSourceFiles() const;
|
2012-09-17 14:02:24 +04:00
|
|
|
|
2012-03-07 20:44:48 +04:00
|
|
|
cmTarget* Target;
|
|
|
|
cmMakefile* Makefile;
|
|
|
|
cmLocalGenerator* LocalGenerator;
|
|
|
|
cmGlobalGenerator* GlobalGenerator;
|
|
|
|
|
|
|
|
/** Sources classified by purpose. */
|
|
|
|
std::vector<cmSourceFile*> CustomCommands;
|
|
|
|
std::vector<cmSourceFile*> ExtraSources;
|
|
|
|
std::vector<cmSourceFile*> HeaderSources;
|
|
|
|
std::vector<cmSourceFile*> ObjectSources;
|
|
|
|
std::vector<cmSourceFile*> ExternalObjects;
|
2012-03-19 19:25:21 +04:00
|
|
|
std::vector<cmSourceFile*> IDLSources;
|
2013-04-29 18:48:22 +04:00
|
|
|
std::vector<cmSourceFile*> ResxSources;
|
|
|
|
|
2012-03-07 20:44:48 +04:00
|
|
|
std::string ModuleDefinitionFile;
|
|
|
|
|
2012-03-07 23:01:46 +04:00
|
|
|
std::map<cmSourceFile const*, std::string> Objects;
|
2012-03-07 23:04:33 +04:00
|
|
|
std::set<cmSourceFile const*> ExplicitObjectName;
|
2012-03-07 23:01:46 +04:00
|
|
|
|
2013-04-29 18:48:22 +04:00
|
|
|
std::set<std::string> ExpectedResxHeaders;
|
|
|
|
|
2012-03-09 01:32:03 +04:00
|
|
|
/** Full path with trailing slash to the top-level directory
|
|
|
|
holding object files for this target. Includes the build
|
|
|
|
time config name placeholder if needed for the generator. */
|
|
|
|
std::string ObjectDirectory;
|
|
|
|
|
2012-03-12 22:40:58 +04:00
|
|
|
std::vector<cmTarget*> ObjectLibraries;
|
|
|
|
|
2013-11-03 17:10:12 +04:00
|
|
|
void UseObjectLibraries(std::vector<std::string>& objs) const;
|
2012-03-12 22:40:58 +04:00
|
|
|
|
2012-09-16 03:16:43 +04:00
|
|
|
void GetAppleArchs(const char* config,
|
2013-11-03 17:10:12 +04:00
|
|
|
std::vector<std::string>& archVec) const;
|
2012-09-16 03:19:54 +04:00
|
|
|
|
|
|
|
///! Return the rule variable used to create this type of target,
|
|
|
|
// need to add CMAKE_(LANG) for full name.
|
2013-11-03 17:10:12 +04:00
|
|
|
const char* GetCreateRuleVariable() const;
|
2012-09-16 03:19:54 +04:00
|
|
|
|
2012-09-16 12:03:42 +04:00
|
|
|
/** Get the include directories for this target. */
|
2012-10-15 12:42:42 +04:00
|
|
|
std::vector<std::string> GetIncludeDirectories(const char *config);
|
2012-09-16 12:03:42 +04:00
|
|
|
|
2013-11-03 17:10:12 +04:00
|
|
|
bool IsSystemIncludeDirectory(const char *dir, const char *config) const;
|
2013-07-02 00:28:26 +04:00
|
|
|
|
2012-09-14 21:04:25 +04:00
|
|
|
/** Add the target output files to the global generator manifest. */
|
2013-11-03 17:10:12 +04:00
|
|
|
void GenerateTargetManifest(const char* config) const;
|
2012-09-14 21:04:25 +04:00
|
|
|
|
2012-10-11 02:57:11 +04:00
|
|
|
/**
|
|
|
|
* Trace through the source files in this target and add al source files
|
|
|
|
* that they depend on, used by all generators
|
|
|
|
*/
|
|
|
|
void TraceDependencies();
|
|
|
|
|
2012-03-07 20:44:48 +04:00
|
|
|
void ClassifySources();
|
2012-03-12 22:40:58 +04:00
|
|
|
void LookupObjectLibraries();
|
2012-03-07 20:44:48 +04:00
|
|
|
|
2012-10-11 02:57:11 +04:00
|
|
|
/** Get sources that must be built before the given source. */
|
2013-11-03 17:10:12 +04:00
|
|
|
std::vector<cmSourceFile*> const* GetSourceDepends(cmSourceFile* sf) const;
|
2012-10-11 02:57:11 +04:00
|
|
|
|
|
|
|
struct SourceEntry { std::vector<cmSourceFile*> Depends; };
|
|
|
|
typedef std::map<cmSourceFile*, SourceEntry> SourceEntriesType;
|
|
|
|
SourceEntriesType SourceEntries;
|
|
|
|
|
2012-10-06 20:35:37 +04:00
|
|
|
private:
|
2013-11-03 17:10:12 +04:00
|
|
|
mutable std::map<std::string, std::vector<std::string> > SystemIncludesCache;
|
2013-07-02 16:30:10 +04:00
|
|
|
|
2012-03-07 20:44:48 +04:00
|
|
|
cmGeneratorTarget(cmGeneratorTarget const&);
|
|
|
|
void operator=(cmGeneratorTarget const&);
|
|
|
|
};
|
|
|
|
|
2012-09-13 02:03:23 +04:00
|
|
|
typedef std::map<cmTarget*, cmGeneratorTarget*> cmGeneratorTargetsType;
|
|
|
|
|
2012-03-07 20:44:48 +04:00
|
|
|
#endif
|