MantisBT - CMake
View Issue Details
0010072CMakeCMakepublic2009-12-22 03:282013-10-07 10:03
Dmitry 
Brad King 
normalminoralways
closedfixed 
CMake 2.8.10.2 
CMake 2.8.11CMake 2.8.11 
0010072: invalid binary path if makefile in root directory
OS: windows server 2008
cmake 2.6, 2.8

I try to build my project with following command:
k:\output> cmake k:\
(structure of my build scripts requires sources to be in root directory of disk)
In this case subprojects binary directories are generated in error form
k:/outputsubproj1
k:/outputsubproj2
instead of
k:/output/subproj1
k:/output/subproj2
It turned out that there is a bug in cmake-2.6.4\Source\cmAddSubDirectoryCommand.cxx : 130
Debugging code
...
    cmSystemTools::ReplaceString(binPath,
                                 this->Makefile->GetCurrentDirectory(),
                                 this->Makefile->GetCurrentOutputDirectory());
...
i found out that in terms of ReplaceString method
preconditions are:
 src="k:/subproj1"
 repl="k:/"
 with="k:/output"
postconditions are:
 src="k:/outputsubproj1"

Thats a point!
Virtual k:\ drive is mapped from original source directory with SUBST command.
No tags attached.
related to 0010994closed Brad King Windows: find_* commands can find paths with no drive letter 
has duplicate 0011153closed  cmake out of source build writes build files at source dirs 
tgz sample.tgz (493) 2009-12-22 09:49
https://public.kitware.com/Bug/file/2739/sample.tgz
patch cmake.patch (1,486) 2013-03-11 17:10
https://public.kitware.com/Bug/file/4679/cmake.patch
Issue History
2009-12-22 03:28DmitryNew Issue
2009-12-22 09:01Bill HoffmanNote Added: 0018969
2009-12-22 09:01Bill HoffmanStatusnew => assigned
2009-12-22 09:01Bill HoffmanAssigned To => Bill Hoffman
2009-12-22 09:05DmitryNote Added: 0018970
2009-12-22 09:20Bill HoffmanNote Added: 0018971
2009-12-22 09:49DmitryFile Added: sample.tgz
2009-12-22 09:50DmitryNote Added: 0018972
2009-12-22 09:52DmitryNote Added: 0018973
2012-01-18 08:41Ananta PalaniNote Added: 0028349
2012-01-18 08:46Ananta PalaniNote Deleted: 0028349
2012-01-18 16:11Patrick SpendrinNote Added: 0028359
2013-02-05 15:53Graham MenhennittNote Added: 0032201
2013-03-08 08:03Brad KingNote Added: 0032536
2013-03-08 08:03Brad KingRelationship addedhas duplicate 0011153
2013-03-08 08:04Brad KingRelationship addedrelated to 0010994
2013-03-08 08:06Brad KingNote Added: 0032538
2013-03-08 08:06Brad KingAssigned ToBill Hoffman =>
2013-03-08 08:06Brad KingStatusassigned => backlog
2013-03-08 08:06Brad KingProduct VersionCMake-2-6 => CMake 2.8.10.2
2013-03-11 17:10Graham MenhennittFile Added: cmake.patch
2013-03-11 17:11Graham MenhennittNote Added: 0032585
2013-03-12 11:44Brad KingAssigned To => Brad King
2013-03-12 11:44Brad KingStatusbacklog => assigned
2013-03-12 11:44Brad KingTarget Version => CMake 2.8.11
2013-03-12 13:51Brad KingNote Added: 0032592
2013-03-12 13:51Brad KingStatusassigned => resolved
2013-03-12 13:51Brad KingResolutionopen => fixed
2013-03-12 13:51Brad KingFixed in Version => CMake 2.8.11
2013-10-07 10:03Robert MaynardNote Added: 0033990
2013-10-07 10:03Robert MaynardStatusresolved => closed

Notes
(0018969)
Bill Hoffman   
2009-12-22 09:01   
What if you do

k:\output> cmake ..


Or

k:\output> cmake \
(0018970)
Dmitry   
2009-12-22 09:05   
1.
k:\output> cmake ..
original fail described above
2.
k:\output> cmake \
CMake Error: The source directory "K:/output" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
(0018971)
Bill Hoffman   
2009-12-22 09:20   
Make sure there is no CMakeCache.txt in k:\

I just tried this and it worked:


C:\>cd b

C:\b>dir
 Volume in drive C has no label.
 Volume Serial Number is 0C67-474C

 Directory of C:\b

12/22/2009 09:26 AM <DIR> .
12/22/2009 09:26 AM <DIR> ..
               0 File(s) 0 bytes
               2 Dir(s) 24,834,404,352 bytes free

C:\b>"c:\Program Files\CMake 2.8\bin\cmake.exe" ..
-- Building for: Visual Studio 10
-- Check for working C compiler: C:/Program Files/BullseyeCoverage/bin/cl.exe
-- Check for working C compiler: C:/Program Files/BullseyeCoverage/bin/cl.exe --
 works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/BullseyeCoverage/bin/cl.exe
-- Check for working CXX compiler: C:/Program Files/BullseyeCoverage/bin/cl.exe
-- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
hello
-- Configuring done
-- Generating done
-- Build files have been written to: C:/b

C:\b>
(0018972)
Dmitry   
2009-12-22 09:50   
ok. I attached sample project and here is results of it's build in two different cases.

1.
I:\out>cmake ..
-- Check for working C compiler: cl
-- Check for working C compiler: cl -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: cl
-- Check for working CXX compiler: cl -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
TEST_DIR: I:/outw01-cpp
-- Configuring done
-- Generating done
-- Build files have been written to: I:/out

2.
F:\Users\ke-user\cmake_bug\out>cmake ..
-- Check for working C compiler: cl
-- Check for working C compiler: cl -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: cl
-- Check for working CXX compiler: cl -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
TEST_DIR: F:/Users/ke-user/cmake_bug/out/w01-cpp
-- Configuring done
-- Generating done
-- Build files have been written to: F:/Users/ke-user/cmake_bug/out

compare TEST_DIR messages
(0018973)
Dmitry   
2009-12-22 09:52   
oh, i forgot notes.
1. it was made by cmake 2.6.4, downloaded from site in binary package
2. "F:\Users\ke-user\cmake_bug" is mapped on virtual drive "I:"
(0028359)
Patrick Spendrin   
2012-01-18 16:11   
a duplicate of this bug can be found here: http://www.cmake.org/Bug/view.php?id=11153 [^]
(0032201)
Graham Menhennitt   
2013-02-05 15:53   
This bug still exists in 2.8.10.2 and it's very annoying. The fix is trivial - can we please get it fixed before the next release.

Thanks,
  Graham
(0032536)
Brad King   
2013-03-08 08:03   
If the fix is trivial please post a patch. I see no proposed fix in the discussion here or 0011153.
(0032538)
Brad King   
2013-03-08 08:06   
Moving to backlog until a fix is proposed.
(0032585)
Graham Menhennitt   
2013-03-11 17:11   
Patch appended. Please apply before 2.8.11.

Thanks,
  Graham
(0032592)
Brad King   
2013-03-12 13:51   
Re 0010072:0032585: Thanks for the patch. Based on that I constructed one that covers this case and more:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=1df49282 [^]
(0033990)
Robert Maynard   
2013-10-07 10:03   
Closing resolved issues that have not been updated in more than 4 months.