1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmDependsFortran.h,v $
6 <<<<<<< cmDependsFortran.h
7 Date: $Date: 2008/01/09 15:30:10 $
8 Version: $Revision: 1.14 $
10 Date: $Date: 2008-05-08 14:09:14 $
11 Version: $Revision: 1.15 $
14 Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
15 See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
17 This software is distributed WITHOUT ANY WARRANTY; without even
18 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
19 PURPOSE. See the above copyright notices for more information.
21 =========================================================================*/
22 #ifndef cmDependsFortran_h
23 #define cmDependsFortran_h
25 #include "cmDepends.h"
27 class cmDependsFortranInternals
;
28 class cmDependsFortranSourceInfo
;
30 /** \class cmDependsFortran
31 * \brief Dependency scanner for Fortran object files.
33 class cmDependsFortran
: public cmDepends
36 /** Checking instances need to know the build directory name and the
37 relative path from the build directory to the target file. */
40 /** Scanning need to know the build directory name, the relative
41 path from the build directory to the target file, the source
42 file from which to start scanning, the include file search
43 path, and the target directory. */
44 cmDependsFortran(cmLocalGenerator
* lg
);
46 /** Virtual destructor to cleanup subclasses properly. */
47 virtual ~cmDependsFortran();
49 /** Callback from build system after a .mod file has been generated
50 by a Fortran90 compiler to copy the .mod file to the
51 corresponding stamp file. */
52 static bool CopyModule(const std::vector
<std::string
>& args
);
54 /** Determine if a mod file and the corresponding mod.stamp file
55 are representing different module information. */
56 static bool ModulesDiffer(const char* modFile
, const char* stampFile
,
57 const char* compilerId
);
59 /** Method to find an included file in the include path. Fortran
60 always searches the directory containing the including source
62 bool FindIncludeFile(const char* dir
, const char* includeName
,
63 std::string
& fileName
);
66 // Finalize the dependency information for the target.
67 virtual bool Finalize(std::ostream
& makeDepends
,
68 std::ostream
& internalDepends
);
70 // Find all the modules required by the target.
72 void MatchLocalModules();
73 void MatchRemoteModules(std::istream
& fin
, const char* stampDir
);
74 void ConsiderModule(const char* name
, const char* stampDir
);
75 bool FindModule(std::string
const& name
, std::string
& module
);
77 // Implement writing/checking methods required by superclass.
78 virtual bool WriteDependencies(
79 const char *src
, const char *file
,
80 std::ostream
& makeDepends
, std::ostream
& internalDepends
);
82 // Actually write the depenencies to the streams.
83 bool WriteDependenciesReal(const char *obj
,
84 cmDependsFortranSourceInfo
const& info
,
85 const char* mod_dir
, const char* stamp_dir
,
86 std::ostream
& makeDepends
,
87 std::ostream
& internalDepends
);
89 // The source file from which to start scanning.
90 std::string SourceFile
;
92 std::vector
<std::string
> PPDefinitions
;
94 // Internal implementation details.
95 cmDependsFortranInternals
* Internal
;
98 cmDependsFortran(cmDependsFortran
const&); // Purposely not implemented.
99 void operator=(cmDependsFortran
const&); // Purposely not implemented.