2015-07-07 23:37:56 +03:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2015 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 cmCommonTargetGenerator_h
|
|
|
|
#define cmCommonTargetGenerator_h
|
|
|
|
|
|
|
|
#include "cmStandardIncludes.h"
|
|
|
|
|
2015-07-08 22:49:03 +03:00
|
|
|
#include "cmLocalGenerator.h"
|
|
|
|
|
2015-07-08 18:13:11 +03:00
|
|
|
class cmGeneratorTarget;
|
|
|
|
class cmGlobalCommonGenerator;
|
|
|
|
class cmLocalCommonGenerator;
|
|
|
|
class cmMakefile;
|
2015-07-08 22:52:42 +03:00
|
|
|
class cmSourceFile;
|
2015-07-08 18:13:11 +03:00
|
|
|
|
2015-07-07 23:37:56 +03:00
|
|
|
/** \class cmCommonTargetGenerator
|
|
|
|
* \brief Common infrastructure for Makefile and Ninja per-target generators
|
|
|
|
*/
|
|
|
|
class cmCommonTargetGenerator
|
|
|
|
{
|
|
|
|
public:
|
2015-07-29 19:55:58 +03:00
|
|
|
cmCommonTargetGenerator(cmOutputConverter::RelativeRoot wd,
|
|
|
|
cmGeneratorTarget* gt);
|
2015-07-07 23:37:56 +03:00
|
|
|
virtual ~cmCommonTargetGenerator();
|
2015-07-08 18:13:11 +03:00
|
|
|
|
2015-07-08 22:02:11 +03:00
|
|
|
std::string const& GetConfigName() const;
|
|
|
|
|
2015-07-08 18:13:11 +03:00
|
|
|
protected:
|
2015-07-08 21:49:04 +03:00
|
|
|
|
|
|
|
// Add language feature flags.
|
|
|
|
void AddFeatureFlags(std::string& flags, const std::string& lang);
|
|
|
|
|
|
|
|
// Feature query methods.
|
|
|
|
const char* GetFeature(const std::string& feature);
|
|
|
|
bool GetFeatureAsBool(const std::string& feature);
|
|
|
|
|
2015-07-08 22:24:17 +03:00
|
|
|
// Helper to add flag for windows .def file.
|
|
|
|
void AddModuleDefinitionFlag(std::string& flags);
|
|
|
|
|
2015-07-29 19:55:58 +03:00
|
|
|
cmOutputConverter::RelativeRoot WorkingDirectory;
|
2015-07-08 18:13:11 +03:00
|
|
|
cmGeneratorTarget* GeneratorTarget;
|
|
|
|
cmMakefile* Makefile;
|
|
|
|
cmLocalCommonGenerator* LocalGenerator;
|
|
|
|
cmGlobalCommonGenerator* GlobalGenerator;
|
2015-07-08 22:02:11 +03:00
|
|
|
std::string ConfigName;
|
2015-07-08 22:24:17 +03:00
|
|
|
|
|
|
|
// The windows module definition source file (.def), if any.
|
|
|
|
std::string ModuleDefinitionFile;
|
2015-07-08 22:49:03 +03:00
|
|
|
|
2015-07-08 22:50:25 +03:00
|
|
|
// Target-wide Fortran module output directory.
|
|
|
|
bool FortranModuleDirectoryComputed;
|
|
|
|
std::string FortranModuleDirectory;
|
2015-07-29 18:49:00 +03:00
|
|
|
std::string GetFortranModuleDirectory();
|
2015-07-29 20:07:02 +03:00
|
|
|
virtual std::string ComputeFortranModuleDirectory() const;
|
2015-07-08 22:50:25 +03:00
|
|
|
|
|
|
|
// Compute target-specific Fortran language flags.
|
|
|
|
void AddFortranFlags(std::string& flags);
|
|
|
|
|
2015-07-08 22:49:03 +03:00
|
|
|
std::string Convert(std::string const& source,
|
|
|
|
cmLocalGenerator::RelativeRoot relative,
|
|
|
|
cmLocalGenerator::OutputFormat output =
|
|
|
|
cmLocalGenerator::UNCHANGED);
|
2015-07-08 22:52:42 +03:00
|
|
|
|
|
|
|
void AppendFortranFormatFlags(std::string& flags,
|
|
|
|
cmSourceFile const& source);
|
2015-07-08 23:38:49 +03:00
|
|
|
|
|
|
|
// Return the a string with -F flags on apple
|
|
|
|
std::string GetFrameworkFlags(std::string const& l);
|
2015-07-09 17:05:12 +03:00
|
|
|
|
|
|
|
virtual void AddIncludeFlags(std::string& flags,
|
|
|
|
std::string const& lang) = 0;
|
|
|
|
|
|
|
|
typedef std::map<std::string, std::string> ByLanguageMap;
|
|
|
|
std::string GetFlags(const std::string &l);
|
|
|
|
ByLanguageMap FlagsByLanguage;
|
2015-07-09 17:10:25 +03:00
|
|
|
std::string GetDefines(const std::string &l);
|
|
|
|
ByLanguageMap DefinesByLanguage;
|
2015-07-13 17:35:04 +03:00
|
|
|
std::string GetIncludes(std::string const& l);
|
|
|
|
ByLanguageMap IncludesByLanguage;
|
2015-09-16 17:24:16 +03:00
|
|
|
std::string GetManifests();
|
2015-07-28 21:05:34 +03:00
|
|
|
|
|
|
|
std::vector<std::string> GetLinkedTargetDirectories() const;
|
2015-07-07 23:37:56 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|