[CMake] Segmentation fault

Brad King brad.king at kitware.com
Wed Jul 8 13:28:38 EDT 2015


On 07/08/2015 10:58 AM, Ghyslain Leclerc wrote:
> I think I have found a bug in CMake and as suggested in the
> Mantis Bug Tracker, I am writing here on the list before
> actually filing the bug report in case it’s actually not a bug.
> I have also searched in the already filed bugs for a few minutes
> to see if it already exists and it does not seem to.

Great, thanks.

> I have used the following call in my CMakeLists.txt:
> set_property( TARGET cli PROPERTY LINK_LIBRARIES ${CUR_LINK_LIBS} )
> 
> When the CUR_LINK_LIBS variable is empty, CMake crashed with a
> segmentation fault.

CMake is supposed to just set the property to empty in that case.
It does so for most properties but LINK_LIBRARIES has special
handling which has this bug.  I've drafted a fix:

 set_property: Fix crash when setting LINK_LIBRARIES to nothing
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=7aa9e80e

I've queued this for merge to the 'release' branch for 3.3.

Thanks,
-Brad



More information about the CMake mailing list