2005-01-26 20:33:38 +00:00
|
|
|
/*=========================================================================
|
|
|
|
|
|
|
|
Program: CMake - Cross-Platform Makefile Generator
|
|
|
|
Module: $RCSfile$
|
|
|
|
Language: C++
|
|
|
|
Date: $Date$
|
|
|
|
Version: $Revision$
|
|
|
|
|
|
|
|
Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
|
|
|
|
See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
|
|
|
|
|
|
|
|
This software is distributed WITHOUT ANY WARRANTY; without even
|
|
|
|
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
|
|
|
|
PURPOSE. See the above copyright notices for more information.
|
|
|
|
|
|
|
|
=========================================================================*/
|
|
|
|
#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-01-09 15:30:11 +00:00
|
|
|
cmDependsFortran(std::vector<std::string> const& includes,
|
|
|
|
std::vector<std::string> const& defines);
|
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(
|
|
|
|
const char *src, const char *file,
|
|
|
|
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
|
|
|
|
|
|
|
// The include file search path.
|
2006-03-15 16:02:08 +00:00
|
|
|
std::vector<std::string> const* IncludePath;
|
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
|