Your patch fixes the problem I was seeing.

Thank you,

-kt

-----Original Message-----
From: Brad King [mailto:brad.k...@kitware.com] 
Sent: Thursday, February 04, 2016 10:57 AM
To: Thompson, KT <k...@lanl.gov>
Cc: cmake@cmake.org; Stephen Kelly <steve...@gmail.com>
Subject: Re: [CMake] CMake 3.5.0-rc1 crash (was: CMake 3.5.0-rc1 install is 
missing dependencies)

On 02/04/2016 11:00 AM, Thompson, KT wrote:
> #6 cmInstallCommand::InitialPass (this=0x1417360, args=std::vector of length 
> 5, capacity 5 = {...}) at .../cmake-3.5.0-rc1/Source/cmInstallCommand.cxx:103 
> (at 0x000000000089ac4a)
> #5 cmInstallCommand::HandleExportMode (this=0x1417360, args=std::vector of 
> length 5, capacity 5 = {...}) at 
> .../cmake-3.5.0-rc1/Source/cmInstallCommand.cxx:1379 (at 0x00000000008a802a)
> #4 cmTarget::GetPolicyStatusCMP0022 (this=0x0) at 
> .../cmake-3.5.0-rc1/Source/cmTarget.h:90 (at 0x00000000008c5636)
[snip]
> In cmInstallCommand.cxx, line 1376
> 
> cmTarget* tgt = this->Makefile->FindTarget(te->TargetName);
> 
> is setting tgt to a NULL pointer (0x0) that is dereferenced in the next line

Thanks!  From that I was able to narrow it to a simple test case:

------------------------------------------------------------------------------
$ cat CMakeLists.txt
cmake_minimum_required(VERSION 3.0)
project(Foo C)
add_subdirectory(A)
add_library(B SHARED empty.c)
install(TARGETS B DESTINATION lib EXPORT FooTargets)
install(EXPORT FooTargets DESTINATION lib/cmake/foo 
EXPORT_LINK_INTERFACE_LIBRARIES)

$ cat A/CMakeLists.txt
add_library(A SHARED ../empty.c)
install(TARGETS A DESTINATION lib EXPORT FooTargets)

$ mkdir b ; cd b
$ cmake --version
cmake version 3.5.0-rc1

$ cmake ..
...
Segmentation fault
------------------------------------------------------------------------------

This was likely caused by this change:

 cmExportSet: Store a cmGeneratorTarget.
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=381e7afd#patch6

Here is a fix and a test case:

 install(EXPORT): Fix crash on target in another directory
 https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=290fb8b9

I've queued this for merge to 'release' for inclusion in 3.5.0-rc2.

Thanks,
-Brad
-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to