2009-09-28 19:43:28 +04:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2005-01-26 23:33:38 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2005-01-26 23:33:38 +03:00
|
|
|
|
2009-09-28 19:43:28 +04:00
|
|
|
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.
|
|
|
|
============================================================================*/
|
2005-01-26 23:33:38 +03:00
|
|
|
#ifndef cmDependsFortran_h
|
|
|
|
#define cmDependsFortran_h
|
|
|
|
|
|
|
|
#include "cmDepends.h"
|
|
|
|
|
2007-12-28 19:49:59 +03:00
|
|
|
class cmDependsFortranInternals;
|
|
|
|
class cmDependsFortranSourceInfo;
|
|
|
|
|
2005-01-26 23:33:38 +03:00
|
|
|
/** \class cmDependsFortran
|
|
|
|
* \brief Dependency scanner for Fortran object files.
|
|
|
|
*/
|
|
|
|
class cmDependsFortran: public cmDepends
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
/** Checking instances need to know the build directory name and the
|
|
|
|
relative path from the build directory to the target file. */
|
2005-05-11 21:16:45 +04:00
|
|
|
cmDependsFortran();
|
2005-01-26 23:33:38 +03:00
|
|
|
|
|
|
|
/** Scanning need to know the build directory name, the relative
|
|
|
|
path from the build directory to the target file, the source
|
2007-12-19 22:28:46 +03:00
|
|
|
file from which to start scanning, the include file search
|
|
|
|
path, and the target directory. */
|
2008-05-08 18:09:14 +04:00
|
|
|
cmDependsFortran(cmLocalGenerator* lg);
|
2005-01-26 23:33:38 +03:00
|
|
|
|
|
|
|
/** Virtual destructor to cleanup subclasses properly. */
|
|
|
|
virtual ~cmDependsFortran();
|
|
|
|
|
2005-03-04 00:53:33 +03:00
|
|
|
/** Callback from build system after a .mod file has been generated
|
|
|
|
by a Fortran90 compiler to copy the .mod file to the
|
|
|
|
corresponding stamp file. */
|
|
|
|
static bool CopyModule(const std::vector<std::string>& args);
|
|
|
|
|
2007-12-31 19:25:17 +03:00
|
|
|
/** Determine if a mod file and the corresponding mod.stamp file
|
|
|
|
are representing different module information. */
|
2008-01-02 19:04:52 +03:00
|
|
|
static bool ModulesDiffer(const char* modFile, const char* stampFile,
|
|
|
|
const char* compilerId);
|
2007-12-31 19:25:17 +03:00
|
|
|
|
2005-01-26 23:33:38 +03:00
|
|
|
/** Method to find an included file in the include path. Fortran
|
|
|
|
always searches the directory containing the including source
|
|
|
|
first. */
|
|
|
|
bool FindIncludeFile(const char* dir, const char* includeName,
|
|
|
|
std::string& fileName);
|
|
|
|
|
|
|
|
protected:
|
2007-12-28 19:49:59 +03:00
|
|
|
// Finalize the dependency information for the target.
|
|
|
|
virtual bool Finalize(std::ostream& makeDepends,
|
|
|
|
std::ostream& internalDepends);
|
|
|
|
|
|
|
|
// Find all the modules required by the target.
|
|
|
|
void LocateModules();
|
|
|
|
void MatchLocalModules();
|
2007-12-31 00:11:38 +03:00
|
|
|
void MatchRemoteModules(std::istream& fin, const char* stampDir);
|
|
|
|
void ConsiderModule(const char* name, const char* stampDir);
|
2007-12-28 19:49:59 +03:00
|
|
|
bool FindModule(std::string const& name, std::string& module);
|
|
|
|
|
2005-01-26 23:33:38 +03:00
|
|
|
// Implement writing/checking methods required by superclass.
|
2005-10-12 21:52:29 +04:00
|
|
|
virtual bool WriteDependencies(
|
2012-09-30 19:53:01 +04:00
|
|
|
const std::set<std::string>& sources, const std::string& file,
|
2005-10-12 21:52:29 +04:00
|
|
|
std::ostream& makeDepends, std::ostream& internalDepends);
|
2005-01-26 23:33:38 +03:00
|
|
|
|
2007-12-28 19:49:59 +03:00
|
|
|
// Actually write the depenencies to the streams.
|
|
|
|
bool WriteDependenciesReal(const char *obj,
|
|
|
|
cmDependsFortranSourceInfo const& info,
|
2007-12-31 00:11:38 +03:00
|
|
|
const char* mod_dir, const char* stamp_dir,
|
2007-12-28 19:49:59 +03:00
|
|
|
std::ostream& makeDepends,
|
|
|
|
std::ostream& internalDepends);
|
|
|
|
|
2005-01-26 23:33:38 +03:00
|
|
|
// The source file from which to start scanning.
|
2006-03-15 19:02:08 +03:00
|
|
|
std::string SourceFile;
|
2005-01-26 23:33:38 +03:00
|
|
|
|
2008-01-09 18:30:11 +03:00
|
|
|
std::vector<std::string> PPDefinitions;
|
2005-01-26 23:33:38 +03:00
|
|
|
|
2007-12-28 19:49:59 +03:00
|
|
|
// Internal implementation details.
|
|
|
|
cmDependsFortranInternals* Internal;
|
|
|
|
|
2005-01-26 23:33:38 +03:00
|
|
|
private:
|
|
|
|
cmDependsFortran(cmDependsFortran const&); // Purposely not implemented.
|
|
|
|
void operator=(cmDependsFortran const&); // Purposely not implemented.
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|