Merge branch 'fix-install-EXPORT-crash' into release
This commit is contained in:
commit
656bf0da2c
|
@ -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)
|
||||
{
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
cmake_policy(VERSION 3.2)
|
||||
cmake_policy(SET CMP0062 NEW)
|
||||
|
||||
add_library(iface INTERFACE)
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
cmake_policy(VERSION 3.2)
|
||||
cmake_policy(SET CMP0062 OLD)
|
||||
|
||||
add_library(iface INTERFACE)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
cmake_policy(VERSION 3.2)
|
||||
|
||||
add_library(iface INTERFACE)
|
||||
export(TARGETS iface FILE "${CMAKE_CURRENT_BINARY_DIR}/exported.cmake")
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
|
@ -0,0 +1,2 @@
|
|||
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)
|
||||
|
|
Loading…
Reference in New Issue