2009-09-28 15:43:28 +00:00
|
|
|
/*============================================================================
|
|
|
|
CMake - Cross Platform Makefile Generator
|
|
|
|
Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
|
2005-01-26 20:33:38 +00:00
|
|
|
|
2009-09-28 15:43:28 +00:00
|
|
|
Distributed under the OSI-approved BSD License (the "License");
|
|
|
|
see accompanying file Copyright.txt for details.
|
2005-01-26 20:33:38 +00:00
|
|
|
|
2009-09-28 15:43:28 +00: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 20:33:38 +00:00
|
|
|
#ifndef cmDependsFortran_h
|
|
|
|
#define cmDependsFortran_h
|
|
|
|
|
|
|
|
#include "cmDepends.h"
|
|
|
|
|
2007-12-28 16:49:59 +00:00
|
|
|
class cmDependsFortranInternals;
|
|
|
|
class cmDependsFortranSourceInfo;
|
|
|
|
|
2005-01-26 20:33:38 +00: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 17:16:45 +00:00
|
|
|
cmDependsFortran();
|
2005-01-26 20:33:38 +00: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 19:28:46 +00:00
|
|
|
file from which to start scanning, the include file search
|
|
|
|
path, and the target directory. */
|
2008-05-08 14:09:14 +00:00
|
|
|
cmDependsFortran(cmLocalGenerator* lg);
|
2005-01-26 20:33:38 +00:00
|
|
|
|
|
|
|
/** Virtual destructor to cleanup subclasses properly. */
|
|
|
|
virtual ~cmDependsFortran();
|
|
|
|
|
2005-03-03 21:53:33 +00: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 16:25:17 +00:00
|
|
|
/** Determine if a mod file and the corresponding mod.stamp file
|
|
|
|
are representing different module information. */
|
2008-01-02 16:04:52 +00:00
|
|
|
static bool ModulesDiffer(const char* modFile, const char* stampFile,
|
|
|
|
const char* compilerId);
|
2007-12-31 16:25:17 +00:00
|
|
|
|
2005-01-26 20:33:38 +00: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 16:49:59 +00: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-30 21:11:38 +00:00
|
|
|
void MatchRemoteModules(std::istream& fin, const char* stampDir);
|
|
|
|
void ConsiderModule(const char* name, const char* stampDir);
|
2007-12-28 16:49:59 +00:00
|
|
|
bool FindModule(std::string const& name, std::string& module);
|
|
|
|
|
2005-01-26 20:33:38 +00:00
|
|
|
// Implement writing/checking methods required by superclass.
|
2005-10-12 17:52:29 +00:00
|
|
|
virtual bool WriteDependencies(
|
2012-09-30 15:53:01 +00:00
|
|
|
const std::set<std::string>& sources, const std::string& file,
|
2005-10-12 17:52:29 +00:00
|
|
|
std::ostream& makeDepends, std::ostream& internalDepends);
|
2005-01-26 20:33:38 +00:00
|
|
|
|
2007-12-28 16:49:59 +00:00
|
|
|
// Actually write the depenencies to the streams.
|
|
|
|
bool WriteDependenciesReal(const char *obj,
|
|
|
|
cmDependsFortranSourceInfo const& info,
|
2007-12-30 21:11:38 +00:00
|
|
|
const char* mod_dir, const char* stamp_dir,
|
2007-12-28 16:49:59 +00:00
|
|
|
std::ostream& makeDepends,
|
|
|
|
std::ostream& internalDepends);
|
|
|
|
|
2005-01-26 20:33:38 +00:00
|
|
|
// The source file from which to start scanning.
|
2006-03-15 16:02:08 +00:00
|
|
|
std::string SourceFile;
|
2005-01-26 20:33:38 +00:00
|
|
|
|
2008-01-09 15:30:11 +00:00
|
|
|
std::vector<std::string> PPDefinitions;
|
2005-01-26 20:33:38 +00:00
|
|
|
|
2007-12-28 16:49:59 +00:00
|
|
|
// Internal implementation details.
|
|
|
|
cmDependsFortranInternals* Internal;
|
|
|
|
|
2005-01-26 20:33:38 +00:00
|
|
|
private:
|
|
|
|
cmDependsFortran(cmDependsFortran const&); // Purposely not implemented.
|
|
|
|
void operator=(cmDependsFortran const&); // Purposely not implemented.
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|