BUG: fix some bad changes in progress calc
[cmake.git] / Source / cmDependsFortran.h
blobdae8ad78018474c8311e87897e4074e665c9474c
1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmDependsFortran.h,v $
5 Language: C++
6 Date: $Date: 2008-01-09 15:30:10 $
7 Version: $Revision: 1.14 $
9 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
10 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
12 This software is distributed WITHOUT ANY WARRANTY; without even
13 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
14 PURPOSE. See the above copyright notices for more information.
16 =========================================================================*/
17 #ifndef cmDependsFortran_h
18 #define cmDependsFortran_h
20 #include "cmDepends.h"
22 class cmDependsFortranInternals;
23 class cmDependsFortranSourceInfo;
25 /** \class cmDependsFortran
26 * \brief Dependency scanner for Fortran object files.
28 class cmDependsFortran: public cmDepends
30 public:
31 /** Checking instances need to know the build directory name and the
32 relative path from the build directory to the target file. */
33 cmDependsFortran();
35 /** Scanning need to know the build directory name, the relative
36 path from the build directory to the target file, the source
37 file from which to start scanning, the include file search
38 path, and the target directory. */
39 cmDependsFortran(std::vector<std::string> const& includes,
40 std::vector<std::string> const& defines);
42 /** Virtual destructor to cleanup subclasses properly. */
43 virtual ~cmDependsFortran();
45 /** Callback from build system after a .mod file has been generated
46 by a Fortran90 compiler to copy the .mod file to the
47 corresponding stamp file. */
48 static bool CopyModule(const std::vector<std::string>& args);
50 /** Determine if a mod file and the corresponding mod.stamp file
51 are representing different module information. */
52 static bool ModulesDiffer(const char* modFile, const char* stampFile,
53 const char* compilerId);
55 /** Method to find an included file in the include path. Fortran
56 always searches the directory containing the including source
57 first. */
58 bool FindIncludeFile(const char* dir, const char* includeName,
59 std::string& fileName);
61 protected:
62 // Finalize the dependency information for the target.
63 virtual bool Finalize(std::ostream& makeDepends,
64 std::ostream& internalDepends);
66 // Find all the modules required by the target.
67 void LocateModules();
68 void MatchLocalModules();
69 void MatchRemoteModules(std::istream& fin, const char* stampDir);
70 void ConsiderModule(const char* name, const char* stampDir);
71 bool FindModule(std::string const& name, std::string& module);
73 // Implement writing/checking methods required by superclass.
74 virtual bool WriteDependencies(
75 const char *src, const char *file,
76 std::ostream& makeDepends, std::ostream& internalDepends);
78 // Actually write the depenencies to the streams.
79 bool WriteDependenciesReal(const char *obj,
80 cmDependsFortranSourceInfo const& info,
81 const char* mod_dir, const char* stamp_dir,
82 std::ostream& makeDepends,
83 std::ostream& internalDepends);
85 // The source file from which to start scanning.
86 std::string SourceFile;
88 // The include file search path.
89 std::vector<std::string> const* IncludePath;
90 std::vector<std::string> PPDefinitions;
92 // Internal implementation details.
93 cmDependsFortranInternals* Internal;
95 private:
96 cmDependsFortran(cmDependsFortran const&); // Purposely not implemented.
97 void operator=(cmDependsFortran const&); // Purposely not implemented.
100 #endif