[CMake] Different behaviour between cmake-gui vs cmake using command line mode

David Cole david.cole at kitware.com
Wed Mar 21 09:42:21 EDT 2012


For the same behavior as cmake-gui, use the same build directory. (For
the command line app "cmake", the current working directory is the
build directory... The argument you give the first time you run it is
the source directory.)

Try:

>> cd C:/Arnault/CMT2/test/A/build
>> cmake ..
>> cmake --build .


HTH,
David


On Wed, Mar 21, 2012 at 9:01 AM, Christian Arnault <arnault at lal.in2p3.fr> wrote:
> Hi,
>
> I am using cmake version  2.8.7 both on Windows 7 & on Linux.
>
> In windows, I configure a project with some sources.
>
> 1) Using the cmake-gui tool, I can specify both where to find the sources
> (eg: C:/Arnault/CMT2/test/A) and where to build the binaries (eg:
> C:/Arnault/CMT2/test/A/build)
>
> (My CMakelists.txt stands in C:/Arnault/CMT2/test/A)
>
> ===>  Doing so works perfectly.
>
> 2) Then, I wonder how to obtain the same behaviour using the command mode
> interface...
>
> I tried
>
>> cd C:/Arnault/CMT2/test/A
>> cmake
>
> this is fine but produce a in-source build which is not what I want
>
>> cd C:/Arnault/CMT2/test/A
>> cmake --build build
>
> This does not work since cmake complains as follows:
>
> [CMake Error: The source directory "C:/Arnault/CMT2/test/A/build" does not
> appear to contain CMakeLists.txt.]
>
> ===> Question:
> Can I obtain the same behaviour as when I use the Gui, either by some
> options in the command line interface, or by setting some variables in my
> CMakeLists.txt ?
>
> Thanks for any hint
>
> Regards
> Christian
>
> --
> --------------------------------------------
> | Christian Arnault                        |
> | LAL Bat 200 pièce 03a                    |
> | 91405 Orsay CEDEX                        |
> | phone   : (33) 1 64 46 84 24             |
> | gsm     : (33) 6 77 27 62 30             |
> | fax     : (33) 1 69 07 94 04             |
> | e-mail  : christian.arnault at lal.in2p3.fr |
> --------------------------------------------
>
> --
>
> 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


More information about the CMake mailing list