1 /*=========================================================================
3 Program: CMake - Cross-Platform Makefile Generator
4 Module: $RCSfile: cmDependsFortran.h,v $
6 Date: $Date: 2008-05-08 14:09:14 $
7 Version: $Revision: 1.15 $
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
31 /** Checking instances need to know the build directory name and the
32 relative path from the build directory to the target file. */
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(cmLocalGenerator
* lg
);
41 /** Virtual destructor to cleanup subclasses properly. */
42 virtual ~cmDependsFortran();
44 /** Callback from build system after a .mod file has been generated
45 by a Fortran90 compiler to copy the .mod file to the
46 corresponding stamp file. */
47 static bool CopyModule(const std::vector
<std::string
>& args
);
49 /** Determine if a mod file and the corresponding mod.stamp file
50 are representing different module information. */
51 static bool ModulesDiffer(const char* modFile
, const char* stampFile
,
52 const char* compilerId
);
54 /** Method to find an included file in the include path. Fortran
55 always searches the directory containing the including source
57 bool FindIncludeFile(const char* dir
, const char* includeName
,
58 std::string
& fileName
);
61 // Finalize the dependency information for the target.
62 virtual bool Finalize(std::ostream
& makeDepends
,
63 std::ostream
& internalDepends
);
65 // Find all the modules required by the target.
67 void MatchLocalModules();
68 void MatchRemoteModules(std::istream
& fin
, const char* stampDir
);
69 void ConsiderModule(const char* name
, const char* stampDir
);
70 bool FindModule(std::string
const& name
, std::string
& module
);
72 // Implement writing/checking methods required by superclass.
73 virtual bool WriteDependencies(
74 const char *src
, const char *file
,
75 std::ostream
& makeDepends
, std::ostream
& internalDepends
);
77 // Actually write the depenencies to the streams.
78 bool WriteDependenciesReal(const char *obj
,
79 cmDependsFortranSourceInfo
const& info
,
80 const char* mod_dir
, const char* stamp_dir
,
81 std::ostream
& makeDepends
,
82 std::ostream
& internalDepends
);
84 // The source file from which to start scanning.
85 std::string SourceFile
;
87 std::vector
<std::string
> PPDefinitions
;
89 // Internal implementation details.
90 cmDependsFortranInternals
* Internal
;
93 cmDependsFortran(cmDependsFortran
const&); // Purposely not implemented.
94 void operator=(cmDependsFortran
const&); // Purposely not implemented.