diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx index 2f2ea4eca..e8b6fdb87 100644 --- a/Source/cmTarget.cxx +++ b/Source/cmTarget.cxx @@ -694,16 +694,8 @@ void cmTarget::GenerateSourceFilesFromSourceLists( cmMakefile &mf) this->SourceFiles.push_back(mf.AddSource(file)); } } - - // expand any link library variables whle we are at it - LinkLibraryVectorType::iterator p = this->LinkLibraries.begin(); - for (;p != this->LinkLibraries.end(); ++p) - { - mf.ExpandVariablesInString(p->first, true, true); - } } - void cmTarget::MergeLinkLibraries( cmMakefile& mf, const char *selfname, const LinkLibraryVectorType& libs ) @@ -977,6 +969,19 @@ cmTarget::AnalyzeLibDependencies( const cmMakefile& mf ) // cyclic dependencies, so this is probably not a big deal. Note that // the link line is always correct, just not necessary optimal. + { + // Expand variables in link library names. This is for backwards + // compatibility with very early CMake versions and should + // eventually be removed. This code was moved here from the end of + // old source list processing code which was called just before this + // method. + for(LinkLibraryVectorType::iterator p = this->LinkLibraries.begin(); + p != this->LinkLibraries.end(); ++p) + { + this->Makefile->ExpandVariablesInString(p->first, true, true); + } + } + typedef std::vector< std::string > LinkLine; // The dependency map.