[cmake-developers] [CMake 0015134]: add_subdirectory() fails when CMakeLists.txt in drive root

Mantis Bug Tracker mantis at public.kitware.com
Mon Sep 8 02:47:25 EDT 2014


The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=15134 
====================================================================== 
Reported By:                Mattes D
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15134
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-09-08 02:47 EDT
Last Modified:              2014-09-08 02:47 EDT
====================================================================== 
Summary:                    add_subdirectory() fails when CMakeLists.txt in
drive root
Description: 
I'm using the "subst" command on windows to make my build folder the root of a
separate drive. Thus, the cmake file being processed is called
"N:\CMakeLists.txt". CMake then fails to process the file, with several errors,
all following the pattern:

CMake Error at N://CMakeLists.txt:66 (add_subdirectory):
  add_subdirectory not given a binary directory but the given source
  directory "N:/lib/jsoncpp" is not a subdirectory of "N:/".  When specifying
  an out-of-tree source a binary directory must be explicitly specified.

CMake Error at N://CMakeLists.txt:76 (get_property):
  get_property DIRECTORY scope provided but requested directory was not
  found.  This could be because the directory argument was invalid or, it is
  valid but has not been processed yet.

The very same cmake file, when used in a subfolder, works without a problem.
For your reference, the CMakeLists.txt file being used is this one:
https://github.com/mc-server/MCServer/blob/562b2d1d1de7438bc763d778b56b0743affd1b5b/CMakeLists.txt
Cmake is being called as:
cmake -G "Visual Studio 9 2008" .

Steps to Reproduce: 
Use subst to map a folder containing a project to a separate drive letter. Then
use CMake in that drive's root to configure the project. CMake fails with the
specified error.
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-09-08 02:47 Mattes D       New Issue                                    
======================================================================



More information about the cmake-developers mailing list