summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/install/EXPORT-OldIFace/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2016-02-04 16:45:54 (GMT)
committerBrad King <brad.king@kitware.com>2016-02-05 14:45:16 (GMT)
commit47460f3e152a59af81edd816cdfe6e0d54e38090 (patch)
tree4db4f048cb75a50ebc2031db57fa834d816c3afc /Tests/RunCMake/install/EXPORT-OldIFace/CMakeLists.txt
parente86383e135e4cae9d54575445d945df1f6272b3a (diff)
downloadCMake-47460f3e152a59af81edd816cdfe6e0d54e38090.zip
CMake-47460f3e152a59af81edd816cdfe6e0d54e38090.tar.gz
CMake-47460f3e152a59af81edd816cdfe6e0d54e38090.tar.bz2
install(EXPORT): Fix crash on target in another directory
Refactoring merged by commit v3.5.0-rc1~299 (Merge topic 'use-generator-target', 2015-10-20) in and around commit v3.5.0-rc1~299^2~13 (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@lanl.gov>
Diffstat (limited to 'Tests/RunCMake/install/EXPORT-OldIFace/CMakeLists.txt')
-rw-r--r--Tests/RunCMake/install/EXPORT-OldIFace/CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
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)