This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "CMake".
The branch, next has been updated via 12076cd6c38a8085e85a8a626ae869bd000a0f25 (commit) via d936eae8c1784ac3257dd5031defb4e2cad11924 (commit) from 4b0ce0697c01f87143509f12ff0bc35242bf45b6 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=12076cd6c38a8085e85a8a626ae869bd000a0f25 commit 12076cd6c38a8085e85a8a626ae869bd000a0f25 Merge: 4b0ce06 d936eae Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Sun Jan 20 13:39:26 2013 -0500 Commit: CMake Topic Stage <kwro...@kitware.com> CommitDate: Sun Jan 20 13:39:26 2013 -0500 Merge topic 'fix-tll-IMPORTED-targets' into next d936eae Fix use of target_link_libraries with an IMPORTED target. http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d936eae8c1784ac3257dd5031defb4e2cad11924 commit d936eae8c1784ac3257dd5031defb4e2cad11924 Author: Stephen Kelly <steve...@gmail.com> AuthorDate: Sun Jan 20 19:29:43 2013 +0100 Commit: Stephen Kelly <steve...@gmail.com> CommitDate: Sun Jan 20 19:38:01 2013 +0100 Fix use of target_link_libraries with an IMPORTED target. cmTarget::MaybeInvalidatePropertyCache only invalidates the cache for properties matching "IMPORTED_*". We need to append in the tll implementation to the IMPORTED_LINK_INTERFACE_LIBRARIES_NOCONFIG property, because that is what is read by cmTarget::ComputeImportInfo in the case of no config. diff --git a/Source/cmTargetLinkLibrariesCommand.cxx b/Source/cmTargetLinkLibrariesCommand.cxx index 0705fb4..a2c6148 100644 --- a/Source/cmTargetLinkLibrariesCommand.cxx +++ b/Source/cmTargetLinkLibrariesCommand.cxx @@ -285,6 +285,15 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, this->Makefile->GetCMakeInstance()->GetDebugConfigs(); std::string prop; + std::string prefix; + std::string suffix; + + if (this->Target->IsImported()) + { + prefix = "IMPORTED_"; + suffix = "_NOCONFIG"; + } + // Include this library in the link interface for the target. if(llt == cmTarget::DEBUG || llt == cmTarget::GENERAL) { @@ -292,7 +301,7 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, for(std::vector<std::string>::const_iterator i = debugConfigs.begin(); i != debugConfigs.end(); ++i) { - prop = "LINK_INTERFACE_LIBRARIES_"; + prop = prefix + "LINK_INTERFACE_LIBRARIES_"; prop += *i; this->Target->AppendProperty(prop.c_str(), lib); } @@ -300,14 +309,14 @@ cmTargetLinkLibrariesCommand::HandleLibrary(const char* lib, if(llt == cmTarget::OPTIMIZED || llt == cmTarget::GENERAL) { // Put in the non-DEBUG configuration interfaces. - this->Target->AppendProperty("LINK_INTERFACE_LIBRARIES", lib); + this->Target->AppendProperty((prefix + "LINK_INTERFACE_LIBRARIES" + suffix).c_str(), lib); // Make sure the DEBUG configuration interfaces exist so that the // general one will not be used as a fall-back. for(std::vector<std::string>::const_iterator i = debugConfigs.begin(); i != debugConfigs.end(); ++i) { - prop = "LINK_INTERFACE_LIBRARIES_"; + prop = prefix + "LINK_INTERFACE_LIBRARIES_"; prop += *i; if(!this->Target->GetProperty(prop.c_str())) { diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index dd615d1..b015143 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -180,6 +180,12 @@ set_property(TARGET testSharedLibDepends APPEND PROPERTY ) generate_export_header(testSharedLibDepends) +add_library(testSharedLibImportDepend SHARED testSharedLibImportDepend.cpp) +set_property(TARGET testSharedLibImportDepend APPEND PROPERTY + INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}" +) +generate_export_header(testSharedLibImportDepend) + set_property(TARGET testSharedLibDepends APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:testSharedLibRequired,INTERFACE_INCLUDE_DIRECTORIES> @@ -203,7 +209,7 @@ install(TARGETS testLibRequired EXPORT RequiredExp DESTINATION lib ) install(EXPORT RequiredExp NAMESPACE Req:: FILE testLibRequiredConfig.cmake DESTINATION lib/cmake/testLibRequired) -install(TARGETS testLibDepends testSharedLibDepends EXPORT DependsExp DESTINATION lib ) +install(TARGETS testLibDepends testSharedLibDepends testSharedLibImportDepend EXPORT DependsExp DESTINATION lib ) install(EXPORT DependsExp FILE testLibDependsConfig.cmake DESTINATION lib/cmake/testLibDepends) @@ -256,7 +262,7 @@ add_subdirectory(sublib) # For CMAKE_BUILD_INTERFACE_INCLUDES test. # Export from build tree. export(TARGETS testExe1 testLib1 testLib2 testLib3 testExe2libImp testLib3Imp testLib3ImpDep subdirlib - testSharedLibRequired testSharedLibDepends + testSharedLibRequired testSharedLibDepends testSharedLibImportDepend NAMESPACE bld_ FILE ExportBuildTree.cmake ) diff --git a/Tests/ExportImport/Export/testSharedLibImportDepend.cpp b/Tests/ExportImport/Export/testSharedLibImportDepend.cpp new file mode 100644 index 0000000..dab2952 --- /dev/null +++ b/Tests/ExportImport/Export/testSharedLibImportDepend.cpp @@ -0,0 +1,7 @@ + +#include "testSharedLibImportDepend.h" + +int TestSharedLibImportDepend::foo() +{ + return 0; +} diff --git a/Tests/ExportImport/Export/testSharedLibImportDepend.h b/Tests/ExportImport/Export/testSharedLibImportDepend.h new file mode 100644 index 0000000..18cb7fa --- /dev/null +++ b/Tests/ExportImport/Export/testSharedLibImportDepend.h @@ -0,0 +1,12 @@ + +#ifndef TESTSHAREDLIBIMPORTDEPEND_H +#define TESTSHAREDLIBIMPORTDEPEND_H + +#include "testsharedlibimportdepend_export.h" + +struct TESTSHAREDLIBIMPORTDEPEND_EXPORT TestSharedLibImportDepend +{ + int foo(); +}; + +#endif diff --git a/Tests/ExportImport/Import/A/CMakeLists.txt b/Tests/ExportImport/Import/A/CMakeLists.txt index 4812e7e..7aa69c6 100644 --- a/Tests/ExportImport/Import/A/CMakeLists.txt +++ b/Tests/ExportImport/Import/A/CMakeLists.txt @@ -162,6 +162,19 @@ target_link_libraries(deps_iface testLibDepends) target_include_directories(deps_iface PRIVATE testLibDepends) target_compile_definitions(deps_iface PRIVATE testLibDepends) +target_link_libraries(testSharedLibDepends + LINK_INTERFACE_LIBRARIES + testSharedLibImportDepend +) +target_include_directories(testSharedLibDepends + INTERFACE + testSharedLibImportDepend +) +target_compile_definitions(testSharedLibDepends + INTERFACE + testSharedLibImportDepend +) + add_executable(deps_shared_iface deps_shared_iface.cpp) target_link_libraries(deps_shared_iface testSharedLibDepends) target_include_directories(deps_shared_iface PRIVATE testSharedLibDepends) @@ -181,6 +194,9 @@ else() endif() endif() +# LinkDependent libraries are populated on export. Why? Should they be? +# Does that depend on the non-genex content of LINK_INTERFACE_LIBRARIES? + if (run_pic_test) target_compile_definitions(deps_shared_iface PRIVATE CHECK_PIC_WORKS) endif() @@ -189,6 +205,18 @@ endif() # Test that targets imported from the build tree have their dependencies # evaluated correctly. The above already tests the same for the install tree. +target_link_libraries(bld_testSharedLibDepends + LINK_INTERFACE_LIBRARIES + bld_testSharedLibImportDepend +) +target_include_directories(bld_testSharedLibDepends + INTERFACE + bld_testSharedLibImportDepend +) +target_compile_definitions(bld_testSharedLibDepends + INTERFACE + bld_testSharedLibImportDepend +) add_executable(deps_shared_iface2 deps_shared_iface.cpp) target_link_libraries(deps_shared_iface2 bld_testSharedLibDepends bld_subdirlib) target_include_directories(deps_shared_iface2 PRIVATE bld_testSharedLibDepends bld_subdirlib) diff --git a/Tests/ExportImport/Import/A/deps_shared_iface.cpp b/Tests/ExportImport/Import/A/deps_shared_iface.cpp index 43f832a..288a1a1 100644 --- a/Tests/ExportImport/Import/A/deps_shared_iface.cpp +++ b/Tests/ExportImport/Import/A/deps_shared_iface.cpp @@ -2,6 +2,8 @@ #include "testSharedLibDepends.h" +#include "testSharedLibImportDepend.h" + #ifdef CHECK_PIC_WORKS #if defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__) #error Expected by INTERFACE_POSITION_INDEPENDENT_CODE property of dependency @@ -16,12 +18,13 @@ int main(int,char **) { TestSharedLibDepends dep; TestSharedLibRequired req; + TestSharedLibImportDepend imp; #ifdef TEST_SUBDIR_LIB SubDirObject sdo; #endif - return dep.foo() + req.foo() + return dep.foo() + req.foo() + imp.foo() #ifdef TEST_SUBDIR_LIB + sdo.foo() #endif ----------------------------------------------------------------------- Summary of changes: Source/cmTargetLinkLibrariesCommand.cxx | 15 ++++++++-- Tests/ExportImport/Export/CMakeLists.txt | 10 +++++- .../Export/testSharedLibImportDepend.cpp | 7 +++++ .../Export/testSharedLibImportDepend.h | 12 ++++++++ Tests/ExportImport/Import/A/CMakeLists.txt | 28 ++++++++++++++++++++ Tests/ExportImport/Import/A/deps_shared_iface.cpp | 5 +++- 6 files changed, 71 insertions(+), 6 deletions(-) create mode 100644 Tests/ExportImport/Export/testSharedLibImportDepend.cpp create mode 100644 Tests/ExportImport/Export/testSharedLibImportDepend.h hooks/post-receive -- CMake _______________________________________________ Cmake-commits mailing list Cmake-commits@cmake.org http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-commits