diff options
author | Brad King <brad.king@kitware.com> | 2006-01-13 23:18:32 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2006-01-13 23:18:32 (GMT) |
commit | 22c62c9e65817e25b077f88222c682efa0188ccb (patch) | |
tree | 077abb80fc469c06f08cc4509ff72bcbee8384c7 /Source/cmTargetLinkLibrariesCommand.cxx | |
parent | 262295615925c082ec3f98c3fc1f6c259d09ee6f (diff) | |
download | CMake-22c62c9e65817e25b077f88222c682efa0188ccb.zip CMake-22c62c9e65817e25b077f88222c682efa0188ccb.tar.gz CMake-22c62c9e65817e25b077f88222c682efa0188ccb.tar.bz2 |
BUG: Sweeping changes to cleanup computation of target names. This should
fix many bugs related to target names being computed inconsistently.
- Centralized computation of a target's file name to a method in
cmTarget. Now that global knowledge is always available the
*_CMAKE_PATH cache variables are no longer needed.
- Centralized computation of link library command lines and link
directory search order.
- Moved computation of link directories needed to link CMake targets
to be after evaluation of linking dependencies.
This also removed alot of duplicate code in which each version had its
own bugs.
This commit is surrounded by the tags
CMake-TargetNameCentralization1-pre
and
CMake-TargetNameCentralization1-post
so make the large set of changes easy to identify.
Diffstat (limited to 'Source/cmTargetLinkLibrariesCommand.cxx')
-rw-r--r-- | Source/cmTargetLinkLibrariesCommand.cxx | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index b917781..9b35c95 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -66,51 +66,6 @@ bool cmTargetLinkLibrariesCommand::InitialPass(std::vector<std::string> const& a m_Makefile->AddLinkLibraryForTarget(args[0].c_str(),i->c_str(), cmTarget::GENERAL); } - // if this is a library that cmake knows about, and LIBRARY_OUTPUT_PATH - // is not set, then add the link directory - const char* ldir = m_Makefile->GetDefinition("LIBRARY_OUTPUT_PATH"); - if (cmSystemTools::IsOff(ldir)) - { - std::string libPath = *i + "_CMAKE_PATH"; - - const char* dir = m_Makefile->GetDefinition(libPath.c_str()); - if( dir && *dir ) - { - m_Makefile->AddLinkDirectoryForTarget(args[0].c_str(), dir ); - } - else - { - m_HasLocation.push_back(*i); - } - } - else - { - m_Makefile->AddLinkDirectoryForTarget(args[0].c_str(), ldir ); - } } return true; } - -void cmTargetLinkLibrariesCommand::FinalPass() -{ - std::vector<std::string>::size_type cc; - std::string libPath; - if ( !m_Makefile->GetDefinition("CMAKE_IGNORE_DEPENDENCIES_ORDERING") ) - { - for ( cc = 0; cc < m_HasLocation.size(); cc ++ ) - { - libPath = m_HasLocation[cc] + "_CMAKE_PATH"; - const char* dir = m_Makefile->GetDefinition(libPath.c_str()); - if ( dir && *dir ) - { - std::string str = "Library " + m_HasLocation[cc] + - " is defined using ADD_LIBRARY after the library is used " - "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"); - } - } - } -} |