The following issue has been SUBMITTED. ====================================================================== https://public.kitware.com/Bug/view.php?id=16048 ====================================================================== Reported By: arlbranch Assigned To: ====================================================================== Project: CMake Issue ID: 16048 Category: CMake Reproducibility: always Severity: crash Priority: high Status: new ====================================================================== Date Submitted: 2016-04-01 15:22 EDT Last Modified: 2016-04-01 15:22 EDT ====================================================================== Summary: Segfault on target_link_libraries() with aliased target from another subdirectory Description: CMake crashes with a segfault when target_link_libraries is used to add a dependency on an alias of a target that was added in a different subdirectory.
Complete Example ================ [branch@fortuna on /dev/pts/1] 1150 ~/repositories/test/cmake_segfault $ cmake --version cmake version 3.5.1 CMake suite maintained and supported by Kitware (kitware.com/cmake). [branch@fortuna on /dev/pts/1] 1151 ~/repositories/test/cmake_segfault $ ls -lR .: total 12 drwxr-xr-x 2 branch atlsdd 4096 Apr 1 13:37 alib/ drwxr-xr-x 2 branch atlsdd 4096 Apr 1 14:14 blib/ -rw-r--r-- 1 branch atlsdd 98 Apr 1 13:18 CMakeLists.txt ./alib: total 4 -rw-r--r-- 1 branch atlsdd 87 Apr 1 13:24 CMakeLists.txt ./blib: total 4 -rw-r--r-- 1 branch atlsdd 162 Apr 1 13:38 CMakeLists.txt [branch@fortuna on /dev/pts/1] 1152 ~/repositories/test/cmake_segfault $ cat CMakeLists.txt cmake_minimum_required(VERSION 2.8.11) project(top) add_subdirectory(alib) add_subdirectory(blib) [branch@fortuna on /dev/pts/1] 1153 ~/repositories/test/cmake_segfault $ cat alib/CMakeLists.txt add_library(alib alib.c) set_source_files_properties(alib.c PROPERTIES GENERATED TRUE) [branch@fortuna on /dev/pts/1] 1154 ~/repositories/test/cmake_segfault $ cat blib/CMakeLists.txt add_library(blib blib.c) set_source_files_properties(blib.c PROPERTIES GENERATED TRUE) add_library(alib::alib ALIAS alib) target_link_libraries(blib alib::alib) [branch@fortuna on /dev/pts/1] 1155 ~/repositories/test/cmake_segfault $ mkdir build && cd build [branch@fortuna on /dev/pts/1] 1156 ~/repositories/test/cmake_segfault/build $ cmake .. -- The C compiler identification is GNU 5.3.0 -- The CXX compiler identification is GNU 5.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done Segmentation fault (core dumped) Steps to Reproduce: 1) create the project in the Description 2) run cmake against it Additional Information: Also seen on MacOS. This is a regression, cmake 3.4 does not crash. ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2016-04-01 15:22 arlbranch New Issue ====================================================================== -- 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-developers