Commit 656bf0da authored by Brad King's avatar Brad King
Browse files

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

parents 2a768f84 a1ad098d
......@@ -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)
{
......
cmake_policy(VERSION 3.2)
cmake_policy(SET CMP0062 NEW)
add_library(iface INTERFACE)
......
cmake_policy(VERSION 3.2)
cmake_policy(SET CMP0062 OLD)
add_library(iface INTERFACE)
......
cmake_policy(VERSION 3.2)
add_library(iface INTERFACE)
export(TARGETS iface FILE "${CMAKE_CURRENT_BINARY_DIR}/exported.cmake")
......
cmake_minimum_required(VERSION 2.8.12)
cmake_minimum_required(VERSION 3.4)
project(${RunCMake_TEST} NONE)
include(${RunCMake_TEST}.cmake)
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)
add_library(bar SHARED ../empty.c)
install(TARGETS bar DESTINATION lib EXPORT fooExport)
......@@ -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)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment