diff options
author | Brad King <brad.king@kitware.com> | 2008-05-08 14:09:14 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2008-05-08 14:09:14 (GMT) |
commit | 12935b1599a2186950db644ff336aca16d725da0 (patch) | |
tree | a3ca5b852b4896ab4849dba8a7fb20f1182e7d42 /Source/cmDependsFortran.cxx | |
parent | 92198d6b37c26ad5fa41f8cbed28e35af15db1cc (diff) | |
download | CMake-12935b1599a2186950db644ff336aca16d725da0.zip CMake-12935b1599a2186950db644ff336aca16d725da0.tar.gz CMake-12935b1599a2186950db644ff336aca16d725da0.tar.bz2 |
ENH: Light refactoring of implicit dependency scanning configuration implementation.
- Move lookup of config variables from cmLocalUnixMakefileGenerator3 to cmDepends hierarchy.
Diffstat (limited to 'Source/cmDependsFortran.cxx')
-rw-r--r-- | Source/cmDependsFortran.cxx | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/Source/cmDependsFortran.cxx b/Source/cmDependsFortran.cxx index 3d23b80..7329f27 100644 --- a/Source/cmDependsFortran.cxx +++ b/Source/cmDependsFortran.cxx @@ -131,17 +131,25 @@ public: //---------------------------------------------------------------------------- cmDependsFortran::cmDependsFortran(): - IncludePath(0), PPDefinitions(0), Internal(0) + PPDefinitions(0), Internal(0) { } //---------------------------------------------------------------------------- cmDependsFortran -::cmDependsFortran(std::vector<std::string> const& includes, - std::vector<std::string> const& definitions): - IncludePath(&includes), +::cmDependsFortran(cmLocalGenerator* lg): + cmDepends(lg), Internal(new cmDependsFortranInternals) { + // Get the list of definitions. + std::vector<std::string> definitions; + cmMakefile* mf = this->LocalGenerator->GetMakefile(); + if(const char* c_defines = + mf->GetDefinition("CMAKE_TARGET_DEFINITIONS")) + { + cmSystemTools::ExpandListArgument(c_defines, definitions); + } + // translate i.e. FOO=BAR to FOO and add it to the list of defined // preprocessor symbols for(std::vector<std::string>::const_iterator @@ -178,11 +186,6 @@ bool cmDependsFortran::WriteDependencies(const char *src, const char *obj, cmSystemTools::Error("Cannot scan dependencies without an object file."); return false; } - if(!this->IncludePath) - { - cmSystemTools::Error("Cannot scan dependencies without an include path."); - return false; - } // Get the information object for this source. cmDependsFortranSourceInfo& info = @@ -595,7 +598,7 @@ bool cmDependsFortran::FindModule(std::string const& name, // Search the include path for the module. std::string fullName; for(std::vector<std::string>::const_iterator i = - this->IncludePath->begin(); i != this->IncludePath->end(); ++i) + this->IncludePath.begin(); i != this->IncludePath.end(); ++i) { // Try the lower-case name. fullName = *i; @@ -887,7 +890,7 @@ bool cmDependsFortran::FindIncludeFile(const char* dir, // Search the include path for the file. for(std::vector<std::string>::const_iterator i = - this->IncludePath->begin(); i != this->IncludePath->end(); ++i) + this->IncludePath.begin(); i != this->IncludePath.end(); ++i) { fullName = *i; fullName += "/"; |