[cmake-developers] script mode current directory

Brad King brad.king at kitware.com
Fri Oct 2 08:45:43 EDT 2015


On 10/02/2015 08:00 AM, J Decker wrote:
> On Fri, Oct 2, 2015 at 4:40 AM, Tamás Kenéz wrote:
>> In script mode it seems that all the CMAKE_[CURRENT_](BINARY|SOURCE)_DIR
>> variables are set to the current working directory.
> 
> if CMAKE_[CURRENT]_SOURCE_DIR is current directory; you're doing
> something wrong :)   That implies that you're doing an in-source build

Tamas is not doing a build at all but instead running

 cmake -P myscript.cmake

and checking the values of these variables.  Yes, the four variables
are meant to be the current working directory in script mode.  This
should be added to the documentation, but such a patch should also
come with an update to the test suite, perhaps in RunCMake/CommandLine,
that covers the behavior explicitly.

-Brad



More information about the cmake-developers mailing list