Hi all,

My global generator adds some imported libraries in EnableLanguage method, but the TARGET_LINK_LIBRARIES command doesn't obey that fact the libraries are imported.
Here is the code which adds an imported library:

void cmGlobalSymbianMmpGenerator
::EnableLanguage(std::vector<std::string>const& languages,
                cmMakefile* mf, bool optional)
{
   ...
cmTarget* tgt = mf->AddImportedTarget(targetName.c_str(), cmTarget::SHARED_LIBRARY);
   tgt->SetProperty("IMPORTED_IMPLIB", importedImplib.c_str());
}

CMakeLists.txt:
add_executable(test test.cpp)
target_link_libraries(test euser)

I expected to know in my local generator whether the library is shared or not, but currently cmTarget::GetLinkLibraries() gives me cmTarget::GENERAL there.

My observations:
cmTargetLinkLibraries doesn't lookup linked library name in the imported targets, so it assumes it's link type is cmTarget::GENERAL.

cmMakefile::AddImportedTarget() creates a new target object in the cmMakefile::ImportedTargets container, but cmMakefile::AddLinkLibraryForTarget (TARGET_LINK_LIBRARIES essential) does not lookup lib name in that container too.

I am working in the 2.6.2 source tree.
Please, help me to understand where am I wrong.

--
Best regards,
Sergey Rudchenko
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to