Merge topic 'use-generator-target'

9b449e9c cmComputeLinkInformation: Lookup a target only if we have one
This commit is contained in:
Brad King 2015-08-17 10:24:42 -04:00 committed by CMake Topic Stage
commit cb99eff642
3 changed files with 12 additions and 1 deletions

View File

@ -761,7 +761,7 @@ void cmComputeLinkInformation::AddSharedDepItem(std::string const& item,
return;
}
cmGeneratorTarget *gtgt = this->GlobalGenerator->GetGeneratorTarget(tgt);
cmGeneratorTarget *gtgt = 0;
// Get a full path to the dependent shared library.
// Add it to the runtime path computation so that the target being

View File

@ -7,3 +7,4 @@ run_cmake(CMP0023-NEW-2)
run_cmake(MixedSignature)
run_cmake(Separate-PRIVATE-LINK_PRIVATE-uses)
run_cmake(SubDirTarget)
run_cmake(SharedDepNotTarget)

View File

@ -0,0 +1,10 @@
enable_language(C)
set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
add_library(imported SHARED IMPORTED)
set_target_properties(imported PROPERTIES
IMPORTED_LOCATION "imported"
IMPORTED_LINK_DEPENDENT_LIBRARIES "/path/to/libSharedDep.so"
)
add_executable(empty empty.c)
target_link_libraries(empty imported)