[CMake] Specifying out of source build directory from command line

Eric Noulard eric.noulard at gmail.com
Thu Oct 26 03:40:24 EDT 2006


2006/10/26, Martin Lütken <mlu at danware.dk>:
>
>
> How can I specify the build directory from the cmake command line client?
> I can do it from within the GUI, but have not been able to get cmake to
> create it's "make-files"
> in other directories than the default, which is at the source root.

In fact the DEFAULT directory, AFAIK, is not source root
but the working dir where you have launch cmake.

1) If it's your first build

    mkdir my_build_dir
    cd my_build_dir

    cmake /path/to/source_dir

     make

2) if you have already run cmake in "my_build_dir"

     cd my_build_dir
     cmake .


You may find some console/screenshot of such CMake
usage as we document it for our TSP software:
http://download.savannah.nongnu.org/releases/tsp/tsp_programming_tutorial-1.0.pdf

See §2.3 Source Installation.

-- 
Erk


More information about the CMake mailing list