[CMake] Are the [Project name]_SOURCE_DIR variables stored in the cache ?

John Drescher drescherjm at gmail.com
Thu May 1 14:00:03 EDT 2014


On Thu, May 1, 2014 at 1:54 PM, Glenn Coombs <glenn.coombs at gmail.com> wrote:
> What I am saying is that project("foo") should internally execute the
> equivalent of set(foo_SOURCE_DIR "/path/to/source") rather than set(foo
> "/path/to/source" CACHE STRING).  That way it would fail on every run if you
> referenced a project source directory variable before you had done the
> add_subdirectory() for that project.  Currently in that situation it fails
> the first time you run cmake but works as expected on subsequent runs of
> cmake, which I think is odd behaviour.
>

I am saying making this change to not cache the source folder would break

cmake binfolder

and

cmake --build buildfolder

and several other commands that have worked this way for years.

John


More information about the CMake mailing list