ENH: Add CMAKE_IGNORE_DEPENDENCIES_ORDERING to prevent warnings about dependency problems

This commit is contained in:
Andy Cedilnik 2003-10-02 14:50:46 -04:00
parent a1d61afcf6
commit 1e62f2392c

View File

@ -85,19 +85,22 @@ void cmTargetLinkLibrariesCommand::FinalPass()
{ {
std::vector<std::string>::size_type cc; std::vector<std::string>::size_type cc;
std::string libPath; std::string libPath;
for ( cc = 0; cc < m_HasLocation.size(); cc ++ ) if ( !m_Makefile->GetDefinition("CMAKE_IGNORE_DEPENDENCIES_ORDERING") )
{ {
libPath = m_HasLocation[cc] + "_CMAKE_PATH"; for ( cc = 0; cc < m_HasLocation.size(); cc ++ )
const char* dir = m_Makefile->GetDefinition(libPath.c_str());
if ( dir )
{ {
std::string str = "Library " + m_HasLocation[cc] + libPath = m_HasLocation[cc] + "_CMAKE_PATH";
" is defined using ADD_LIBRARY after the library is used " const char* dir = m_Makefile->GetDefinition(libPath.c_str());
"using TARGET_LINK_LIBRARIES for the target " + m_TargetName + if ( dir )
". This breaks CMake's dependency " {
"handling. Please fix the CMakeLists.txt file."; std::string str = "Library " + m_HasLocation[cc] +
this->SetError(str.c_str()); " is defined using ADD_LIBRARY after the library is used "
cmSystemTools::Message(str.c_str(), "CMake Error"); "using TARGET_LINK_LIBRARIES for the target " + m_TargetName +
". This breaks CMake's dependency "
"handling. Please fix the CMakeLists.txt file.";
this->SetError(str.c_str());
cmSystemTools::Message(str.c_str(), "CMake Error");
}
} }
} }
} }