[Cmake-commits] CMake branch, next, updated. v3.5.0-rc1-26-gd57db1d
Brad King
brad.king at kitware.com
Thu Feb 4 12:53:55 EST 2016
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 d57db1d14df72ff5a13aa169a5334a453121ca2c (commit)
via 290fb8b987324dc8fda52d9f2ebbc51d6d9abbac (commit)
from 186352a2c7090d03eabde1919200bc1daadb9e4c (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 -----------------------------------------------------------------
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d57db1d14df72ff5a13aa169a5334a453121ca2c
commit d57db1d14df72ff5a13aa169a5334a453121ca2c
Merge: 186352a 290fb8b
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 4 12:53:54 2016 -0500
Commit: CMake Topic Stage <kwrobot at kitware.com>
CommitDate: Thu Feb 4 12:53:54 2016 -0500
Merge topic 'fix-install-EXPORT-crash' into next
290fb8b9 install(EXPORT): Fix crash on target in another directory
https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=290fb8b987324dc8fda52d9f2ebbc51d6d9abbac
commit 290fb8b987324dc8fda52d9f2ebbc51d6d9abbac
Author: Brad King <brad.king at kitware.com>
AuthorDate: Thu Feb 4 11:45:54 2016 -0500
Commit: Brad King <brad.king at kitware.com>
CommitDate: Thu Feb 4 12:51:49 2016 -0500
install(EXPORT): Fix crash on target in another directory
Refactoring merged by commit 9afbb733ec (Merge topic
'use-generator-target', 2015-10-20) in and around commit 381e7afd
(cmExportSet: Store a cmGeneratorTarget, 2015-10-17) changed export sets
to delay looking up actual targets and stores only their names.
However, in InstallCommand::HandleExportMode we need to lookup targets
immediately to check them for EXPORT_LINK_INTERFACE_LIBRARIES. The
check was accidentally made local to the current directory, so if an
export set contains a target from another directory the lookup fails and
CMake crashes. Fix the check to look up the target name globally, and
tolerate when no target is found just in case.
Reported-by: Kelly Thompson <kgt at lanl.gov>
diff --git a/Source/cmInstallCommand.cxx b/Source/cmInstallCommand.cxx
index 15a83ee..2d78a41 100644
--- a/Source/cmInstallCommand.cxx
+++ b/Source/cmInstallCommand.cxx
@@ -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)
{
diff --git a/Tests/RunCMake/install/EXPORT-OldIFace.cmake b/Tests/RunCMake/install/EXPORT-OldIFace.cmake
new file mode 100644
index 0000000..8dfb46b
--- /dev/null
+++ b/Tests/RunCMake/install/EXPORT-OldIFace.cmake
@@ -0,0 +1,6 @@
+enable_language(C)
+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)
diff --git a/Tests/RunCMake/install/EXPORT-OldIFace/CMakeLists.txt b/Tests/RunCMake/install/EXPORT-OldIFace/CMakeLists.txt
new file mode 100644
index 0000000..32292e2
--- /dev/null
+++ b/Tests/RunCMake/install/EXPORT-OldIFace/CMakeLists.txt
@@ -0,0 +1,2 @@
+add_library(bar SHARED ../empty.c)
+install(TARGETS bar DESTINATION lib EXPORT fooExport)
diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake
index 2c1b29d..c2347d8 100644
--- a/Tests/RunCMake/install/RunCMakeTest.cmake
+++ b/Tests/RunCMake/install/RunCMakeTest.cmake
@@ -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)
-----------------------------------------------------------------------
Summary of changes:
Source/cmInstallCommand.cxx | 8 +++++---
Tests/RunCMake/install/EXPORT-OldIFace.cmake | 6 ++++++
Tests/RunCMake/install/EXPORT-OldIFace/CMakeLists.txt | 2 ++
Tests/RunCMake/install/RunCMakeTest.cmake | 1 +
4 files changed, 14 insertions(+), 3 deletions(-)
create mode 100644 Tests/RunCMake/install/EXPORT-OldIFace.cmake
create mode 100644 Tests/RunCMake/install/EXPORT-OldIFace/CMakeLists.txt
hooks/post-receive
--
CMake
More information about the Cmake-commits
mailing list