2015-07-07 20:37:56 +00: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 19:49:03 +00:00
|
|
|
#include "cmLocalGenerator.h"
|
|
|
|
|
2015-07-08 15:13:11 +00:00
|
|
|
class cmGeneratorTarget;
|
|
|
|
class cmGlobalCommonGenerator;
|
|
|
|
class cmLocalCommonGenerator;
|
|
|
|
class cmMakefile;
|
2015-07-08 19:52:42 +00:00
|
|
|
class cmSourceFile;
|
2015-07-08 15:13:11 +00:00
|
|
|
class cmTarget;
|
|
|
|
|
2015-07-07 20:37:56 +00:00
|
|
|
/** \class cmCommonTargetGenerator
|
|
|
|
* \brief Common infrastructure for Makefile and Ninja per-target generators
|
|
|
|
*/
|
|
|
|
class cmCommonTargetGenerator
|
|
|
|
{
|
|
|
|
public:
|
2015-07-08 15:13:11 +00:00
|
|
|
cmCommonTargetGenerator(cmGeneratorTarget* gt);
|
2015-07-07 20:37:56 +00:00
|
|
|
virtual ~cmCommonTargetGenerator();
|
2015-07-08 15:13:11 +00:00
|
|
|
|
2015-07-08 19:02:11 +00:00
|
|
|
std::string const& GetConfigName() const;
|
|
|
|
|
2015-07-08 15:13:11 +00:00
|
|
|
protected:
|
2015-07-08 18:49:04 +00: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 19:24:17 +00:00
|
|
|
// Helper to add flag for windows .def file.
|
|
|
|
void AddModuleDefinitionFlag(std::string& flags);
|
|
|
|
|
2015-07-08 15:13:11 +00:00
|
|
|
cmGeneratorTarget* GeneratorTarget;
|
|
|
|
cmTarget* Target;
|
|
|
|
cmMakefile* Makefile;
|
|
|
|
cmLocalCommonGenerator* LocalGenerator;
|
|
|
|
cmGlobalCommonGenerator* GlobalGenerator;
|
2015-07-08 19:02:11 +00:00
|
|
|
std::string ConfigName;
|
2015-07-08 19:24:17 +00:00
|
|
|
|
|
|
|
// The windows module definition source file (.def), if any.
|
|
|
|
std::string ModuleDefinitionFile;
|
2015-07-08 19:49:03 +00:00
|
|
|
|
2015-07-08 19:50:25 +00:00
|
|
|
// Target-wide Fortran module output directory.
|
|
|
|
bool FortranModuleDirectoryComputed;
|
|
|
|
std::string FortranModuleDirectory;
|
|
|
|
const char* GetFortranModuleDirectory();
|
|
|
|
|
|
|
|
// Compute target-specific Fortran language flags.
|
|
|
|
void AddFortranFlags(std::string& flags);
|
|
|
|
|
2015-07-08 19:49:03 +00:00
|
|
|
std::string Convert(std::string const& source,
|
|
|
|
cmLocalGenerator::RelativeRoot relative,
|
|
|
|
cmLocalGenerator::OutputFormat output =
|
|
|
|
cmLocalGenerator::UNCHANGED);
|
2015-07-08 19:52:42 +00:00
|
|
|
|
|
|
|
void AppendFortranFormatFlags(std::string& flags,
|
|
|
|
cmSourceFile const& source);
|
2015-07-07 20:37:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|