[CMake] Using cache in -P scripts?

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Oct 23 04:19:22 EDT 2008


On Thu, Oct 23, 2008 at 5:53 AM, Abe Stephens <abe at sci.utah.edu> wrote:
> Hi, Is it possible for a script executed during build (via custom command of
> cmake -P) to load and read values from the project's CMakeCache.txt file? I
> tried using load_cache in the script, but apparently that isn't allowed.
>

You are looking for "-D", warning it needs to be passed *before* -P

       -P <file>
              Process script mode.

              Process the given cmake file as a script written  in  the  CMake
              language.   No  configure  or generate step is performed and the
              cache is not modified. If variables are defined using  -D,  this
              must be done before the -P argument.

2cts
-- 
Mathieu


More information about the CMake mailing list