Re: [CMake] Windows build inconsistency...

2011-06-03 Thread Eric Noulard
2011/6/3 Jean-Christophe Fillion-Robin jchris.filli...@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 :-]

-- 
Erk
Membre de l'April - « promouvoir et défendre le logiciel libre » -
http://www.april.org
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Windows build inconsistency...

2011-06-03 Thread David Cole
On Fri, Jun 3, 2011 at 9:10 AM, Eric Noulard eric.noul...@gmail.com wrote:
 2011/6/3 Jean-Christophe Fillion-Robin jchris.filli...@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.
:-)
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Windows build inconsistency...

2011-06-03 Thread Bill Hoffman



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());
  }




I'm too young to explain this one.
:-)
___


The comment is pretty clear...  :)

It was done so that one windows when you drag a CMakeLists.txt file and 
drop it on the cmake-gui it will do an in-source build where that 
CMakeLists.txt file is.


-Bill


___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


[CMake] Windows build inconsistency...

2011-06-02 Thread The Novice Coder
I've noticed an inconsistency in CMake's generation..  For example I go 
through the following sequence:


cd \Project
mkdir Debug
cd Debug

Then I either:

cmake -G Visual Studio 9 2008 -DCMAKE_BUILD_TYPE=Debug 
..\CMakeLists.txt


It will generate, and then place the project files in \Project.


But if I use:

cmake -G Visual Studio 9 2008 -DCMAKE_BUILD_TYPE=Debug ..

It will generate, and then place the project files in \Project\Debug


Why are these different?
Are the differences expected behavior?
I'm a bit confused..

Thanks!
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake


Re: [CMake] Windows build inconsistency...

2011-06-02 Thread Jean-Christophe Fillion-Robin
Just tested it on linux and the same remark applies.

//-
Case1:
mkdir TestCase1  mkdir TestCase1/Debug  echo PROJECT(foo) 
TestCase1/CMakeLists.txt  cd TestCase1/Debug  cmake ../CMakeLists.txt

Output:
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/local/bin/gcc
-- Check for working C compiler: /usr/local/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/jchris/Projects/TestInSource/TestCase1

//-
Case2:
mkdir TestCase2  mkdir TestCase2/Debug  echo PROJECT(foo) 
TestCase2/CMakeLists.txt  cd TestCase2/Debug  cmake ..

Output
-- The C compiler identification is GNU
-- The CXX compiler identification is GNU
-- Check for working C compiler: /usr/local/bin/gcc
-- Check for working C compiler: /usr/local/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/local/bin/c++
-- Check for working CXX compiler: /usr/local/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Configuring done
-- Generating done
-- Build files have been written to:
/home/jchris/Projects/TestInSource/TestCase2/Debug

Jc

On Thu, Jun 2, 2011 at 6:29 PM, The Novice Coder cm...@randmsystems.comwrote:

 I've noticed an inconsistency in CMake's generation..  For example I go
 through the following sequence:

 cd \Project
 mkdir Debug
 cd Debug

 Then I either:

 cmake -G Visual Studio 9 2008 -DCMAKE_BUILD_TYPE=Debug ..\CMakeLists.txt

 It will generate, and then place the project files in \Project.


 But if I use:

 cmake -G Visual Studio 9 2008 -DCMAKE_BUILD_TYPE=Debug ..

 It will generate, and then place the project files in \Project\Debug


 Why are these different?
 Are the differences expected behavior?
 I'm a bit confused..

 Thanks!
 ___
 Powered by www.kitware.com

 Visit other Kitware open-source projects at
 http://www.kitware.com/opensource/opensource.html

 Please keep messages on-topic and check the CMake FAQ at:
 http://www.cmake.org/Wiki/CMake_FAQ

 Follow this link to subscribe/unsubscribe:
 http://www.cmake.org/mailman/listinfo/cmake




-- 
+1 919 869 8849
___
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake