MantisBT - CMake
View Issue Details
0014608CMakeCMakepublic2013-11-29 10:512013-12-04 12:22
Erik Sjölund 
Stephen Kelly 
normalminoralways
closedfixed 
amd64Ubuntu13.10
CMake 2.8.12 
CMake 3.0 
0014608: segmentation fault when "export(TARGETS nonexistenttarget FILE somefile.cmake")
If "foobar" is not a target, this CMakeLists.txt content triggers a segmentation fault:

export(TARGETS foobar FILE somefile.cmake)


The segmentation fault happens for the nighly build cmake-2.8.12.20131128-ga13cc-Linux-i386 but not for cmake 2.8.11.2 where instead an error message is shown.
user@ubuntu:/tmp$ uname -m
x86_64
user@ubuntu:/tmp$ cat /etc/issue
Ubuntu 13.10 \n \l
user@ubuntu:/tmp$ cat /tmp/CMakeLists.txt
cmake_minimum_required(VERSION 2.8.9 FATAL_ERROR)
export(TARGETS foobar FILE somefile.cmake)
user@ubuntu:/tmp$ cmake --version
cmake version 2.8.11.2
user@ubuntu:/tmp$ dir=`mktemp -d` ; cd $dir
user@ubuntu:/tmp/tmp.Q8C5VD8vgw$ cmake /tmp
CMake Error at CMakeLists.txt:2 (export):
  export given target "foobar" which is not built by this project.


-- Configuring incomplete, errors occurred!
user@ubuntu:/tmp/tmp.Q8C5VD8vgw$ dir=`mktemp -d` ; cd $dir
user@ubuntu:/tmp/tmp.NdOyHKvLMl$ ~/cmake/cmake-2.8.12.20131128-ga13cc-Linux-i386/bin/cmake /tmp
-- Configuring done
Segmentation fault (core dumped)
user@ubuntu:/tmp/tmp.NdOyHKvLMl$
No tags attached.
Issue History
2013-11-29 10:51Erik SjölundNew Issue
2013-12-02 09:36Brad KingAssigned To => Stephen Kelly
2013-12-02 09:36Brad KingStatusnew => assigned
2013-12-04 12:22Stephen KellyNote Added: 0034711
2013-12-04 12:22Stephen KellyStatusassigned => closed
2013-12-04 12:22Stephen KellyResolutionopen => fixed
2013-12-04 12:22Stephen KellyFixed in Version => CMake 3.0

Notes
(0034711)
Stephen Kelly   
2013-12-04 12:22   
Fixed:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1cd1430b1f [^]