[CMake] Windows build inconsistency...
David Cole
david.cole at kitware.com
Fri Jun 3 11:06:38 EDT 2011
On Fri, Jun 3, 2011 at 9:10 AM, Eric Noulard <eric.noulard at gmail.com> wrote:
> 2011/6/3 Jean-Christophe Fillion-Robin <jchris.fillionr at kitware.com>:
>> Just tested it on linux and the same remark applies.
>
> Hi,
>
> I cannot find the answer in the ML archive but I think I already
> crossed that issue in the past
> and I was answered that this was the expected "legacy CMake" behavior.
>
> 1) When you specify a directory path then CMake assume this is a "source dir"
> and will use the current directory as build dir.
>
> 2) When you specify a CMakeLists.txt file it will consider you want to build
> in the directory where the CMakeLists.txt is.
>
> in CMake source one read (see: Source/cmake.cxx:791):
>
> if(argIsFile)
> {
> // Source CMakeLists.txt file given. It was probably dropped
> // onto the executable in a GUI. Default to an in-source build.
> this->SetHomeOutputDirectory(listPath.c_str());
> this->SetStartOutputDirectory(listPath.c_str());
> }
> else
> {
> // Source directory given on command line. Use current working
> // directory as build tree.
> std::string cwd = cmSystemTools::GetCurrentWorkingDirectory();
> this->SetHomeOutputDirectory(cwd.c_str());
> this->SetStartOutputDirectory(cwd.c_str());
> }
>
> So I bet this is purposely done, even if this may be an unexpected
> behavior in the first place.
>
> I don't know the rational for that (beside maintaining some legacy
> behavior) but may be someone
> at kitware is old enough to explain that :-]
>
I'm too young to explain this one.
:-)
More information about the CMake
mailing list