MantisBT - CMake
View Issue Details
0014031CMakeCMakepublic2013-03-20 07:562014-06-02 08:37
Jay Sistar 
Stephen Kelly 
normalcrashalways
closedfixed 
OSXOSX10.8.2
CMake 2.8.10.2 
CMake 2.8.11 
0014031: export() segfault when target list contains undefined target
When using the export() command to export targets for use in another CMake project, if the list of targets passed-in contains a target that does not exists, then an error message should be displayed.

Instead of an error message, CMake 2.8.10.2 on OSX crashes with a segfault.
Create a CMakeLists.txt file with 1 or more add_executable() or add_library() statements.
Add the targets made by the add_executable and/or add_library() to a list.
Add an export() command that is passed the list of target names and generates a something.cmake file.

Running "cmake" on this file should work as expected at this point.

Modify the list such that it also contains an "extra" target in it that doesn't really exist.

Running "cmake" on this file will cause a segfault.
No tags attached.
Issue History
2013-03-20 07:56Jay SistarNew Issue
2013-03-20 09:06Brad KingNote Added: 0032678
2013-11-02 09:17Stephen KellyNote Added: 0034315
2013-11-02 09:17Stephen KellyStatusnew => resolved
2013-11-02 09:17Stephen KellyFixed in Version => CMake 2.8.11
2013-11-02 09:17Stephen KellyResolutionopen => fixed
2013-11-02 09:17Stephen KellyAssigned To => Stephen Kelly
2014-06-02 08:37Robert MaynardNote Added: 0035981
2014-06-02 08:37Robert MaynardStatusresolved => closed

Notes
(0032678)
Brad King   
2013-03-20 09:06   
Does this still occur with a recent nightly build?

 http://www.cmake.org/files/dev/?C=M;O=D [^]

Several significant changes have been made to the relevant code since 2.8.10.2.
(0034315)
Stephen Kelly   
2013-11-02 09:17   
CMake Error at CMakeLists.txt:22 (export):
  export given target "extra" which is not built by this project.


-- Configuring incomplete, errors occurred!
stephen@hal:~/dev/src/playground/cmake/build{master}$ cmake --version
cmake version 2.8.11.2
(0035981)
Robert Maynard   
2014-06-02 08:37   
Closing resolved issues that have not been updated in more than 4 months.