The following issue has been SUBMITTED. ====================================================================== http://www.cmake.org/Bug/view.php?id=15193 ====================================================================== Reported By: Yichao Yu Assigned To: ====================================================================== Project: CMake Issue ID: 15193 Category: CMake Reproducibility: always Severity: minor Priority: normal Status: new ====================================================================== Date Submitted: 2014-10-03 09:01 EDT Last Modified: 2014-10-03 09:01 EDT ====================================================================== Summary: Error when one of the parent directory is a symlink to it's parent directory Description: If one of the parent directory of the source directory is a symlink to one of its parent directory, cmake fails at configure time on add_subdirectory.
Directory structure to reproduce this: ``` % tree . ├── 1 │ ├── 2 │ │ └── cmake │ │ ├── a │ │ │ └── CMakeLists.txt │ │ └── CMakeLists.txt │ └── 4 -> . └── 3 -> 1 6 directories, 2 files ``` The higher level `CMakeLists.txt` is ``` % cat 1/2/cmake/CMakeLists.txt project(cmake-test) cmake_minimum_required(VERSION 2.8) add_subdirectory(a) ``` and the lower level `CMakeLists.txt` is empty. When trying to build in `1/4/2/cmake/build` ``` % cmake .. -- The C compiler identification is GNU 4.9.1 -- The CXX compiler identification is GNU 4.9.1 -- 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 -- 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 CMake Error at CMakeLists.txt:3 (add_subdirectory): add_subdirectory not given a binary directory but the given source directory "/home/yuyichao/tmp/cmake-test/1/4/4/4/2/cmake/a" is not a subdirectory of "/home/yuyichao/tmp/cmake-test/1/4/4/2/cmake". When specifying an out-of-tree source a binary directory must be explicitly specified. -- Configuring incomplete, errors occurred! See also "/home/yuyichao/tmp/cmake-test/1/4/2/cmake/build/CMakeFiles/CMakeOutput.log". ``` Another real life example can be found in the comment here[1] and the qtcurve issue here[2]. [1] http://kde-look.org/content/show.php?content=40492 [2] https://github.com/QtCurve/qtcurve/issues/77 ====================================================================== Issue History Date Modified Username Field Change ====================================================================== 2014-10-03 09:01 Yichao Yu 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