View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015193CMakeCMakepublic2014-10-03 09:012016-06-10 14:31
ReporterYichao Yu 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
Platformx86_64OSLinuxOS VersionArch Linux
Product VersionCMake 3.0.2 
Target VersionFixed in Version 
Summary0015193: Error when one of the parent directory is a symlink to it's parent directory
DescriptionIf 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 [^]
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0041035)
Michal Wirth (reporter)
2016-05-07 05:34

Hi, just confirming same behavior with CMake 3.5.2
(0042642)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2014-10-03 09:01 Yichao Yu New Issue
2016-05-07 05:34 Michal Wirth Note Added: 0041035
2016-06-10 14:29 Kitware Robot Note Added: 0042642
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team