Merge branch 'fix-install-EXPORT-crash' into release

This commit is contained in:
Brad King 2016-02-08 10:46:42 -05:00
commit 656bf0da2c
8 changed files with 19 additions and 6 deletions

View File

@ -1374,10 +1374,12 @@ bool cmInstallCommand::HandleExportMode(std::vector<std::string> const& args)
tei != exportSet->GetTargetExports()->end(); ++tei)
{
cmTargetExport const* te = *tei;
cmTarget* tgt = this->Makefile->FindTarget(te->TargetName);
cmTarget* tgt =
this->Makefile->GetGlobalGenerator()->FindTarget(te->TargetName);
const bool newCMP0022Behavior =
tgt->GetPolicyStatusCMP0022() != cmPolicies::WARN
&& tgt->GetPolicyStatusCMP0022() != cmPolicies::OLD;
(tgt &&
tgt->GetPolicyStatusCMP0022() != cmPolicies::WARN &&
tgt->GetPolicyStatusCMP0022() != cmPolicies::OLD);
if(!newCMP0022Behavior)
{

View File

@ -1,4 +1,4 @@
cmake_policy(VERSION 3.2)
cmake_policy(SET CMP0062 NEW)
add_library(iface INTERFACE)

View File

@ -1,4 +1,4 @@
cmake_policy(VERSION 3.2)
cmake_policy(SET CMP0062 OLD)
add_library(iface INTERFACE)

View File

@ -1,3 +1,4 @@
cmake_policy(VERSION 3.2)
add_library(iface INTERFACE)
export(TARGETS iface FILE "${CMAKE_CURRENT_BINARY_DIR}/exported.cmake")

View File

@ -1,3 +1,3 @@
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.4)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)

View File

@ -0,0 +1,7 @@
enable_language(C)
set(CMAKE_BUILD_WITH_INSTALL_RPATH 1)
add_subdirectory(EXPORT-OldIFace)
add_library(foo SHARED empty.c)
target_link_libraries(foo bar)
install(TARGETS foo DESTINATION lib EXPORT fooExport)
install(EXPORT fooExport DESTINATION lib/cmake/foo EXPORT_LINK_INTERFACE_LIBRARIES)

View File

@ -0,0 +1,2 @@
add_library(bar SHARED ../empty.c)
install(TARGETS bar DESTINATION lib EXPORT fooExport)

View File

@ -10,6 +10,7 @@ run_cmake(DIRECTORY-DIRECTORY-bad)
run_cmake(DIRECTORY-DESTINATION-bad)
run_cmake(FILES-DESTINATION-bad)
run_cmake(TARGETS-DESTINATION-bad)
run_cmake(EXPORT-OldIFace)
run_cmake(CMP0062-OLD)
run_cmake(CMP0062-NEW)
run_cmake(CMP0062-WARN)