You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@corinthia.apache.org by Peter Kelly <pm...@apache.org> on 2015/08/10 09:43:36 UTC

Builds in source directory

I’ve just added a check at the beginning of CMakeLists.txt which makes sure the user is building in a directory other than the root of the source tree. This should avoid the problems we’ve discussed with Visual Studio/XCode projects/Makefiles etc. being put in inconvenient places.

If you now try this in the repository root:

    cmake -G “Unix Makefiles” .

You’ll see the following message:

    Building in the source directory is not supported. Instead, you should
    create another directory specifically for the build. For example:

    mkdir ~/build/corinthia
    cd ~/build/corinthia
    cmake -G "Unix Makefiles" /Users/peter/dev/corinthia

    Before this will work, you should delete CMakeCache.txt and
    the CMakeFiles directory that were just generated in the source
    directory.

(In the above message, the cmake command given uses the generator and source directory given by the user, so you’ll likely see a slight difference when you run it yourself)

—
Dr Peter M. Kelly
pmkelly@apache.org

PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
(fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)


Re: Builds in source directory

Posted by jan i <ja...@apache.org>.
Good catch, better to do it automated.


rgds
jan i.


On 10 August 2015 at 09:43, Peter Kelly <pm...@apache.org> wrote:

> I’ve just added a check at the beginning of CMakeLists.txt which makes
> sure the user is building in a directory other than the root of the source
> tree. This should avoid the problems we’ve discussed with Visual
> Studio/XCode projects/Makefiles etc. being put in inconvenient places.
>
> If you now try this in the repository root:
>
>     cmake -G “Unix Makefiles” .
>
> You’ll see the following message:
>
>     Building in the source directory is not supported. Instead, you should
>     create another directory specifically for the build. For example:
>
>     mkdir ~/build/corinthia
>     cd ~/build/corinthia
>     cmake -G "Unix Makefiles" /Users/peter/dev/corinthia
>
>     Before this will work, you should delete CMakeCache.txt and
>     the CMakeFiles directory that were just generated in the source
>     directory.
>
> (In the above message, the cmake command given uses the generator and
> source directory given by the user, so you’ll likely see a slight
> difference when you run it yourself)
>
> —
> Dr Peter M. Kelly
> pmkelly@apache.org
>
> PGP key: http://www.kellypmk.net/pgp-key <http://www.kellypmk.net/pgp-key>
> (fingerprint 5435 6718 59F0 DD1F BFA0 5E46 2523 BAA1 44AE 2966)
>
>