[Cmake] Override default cache values

Albert Strasheim 13640887 at sun . ac . za
Tue, 25 Nov 2003 21:53:27 +0200


Hello,

On Tue, 25 Nov 2003, Amitha Perera wrote:

> As a hack, perhaps you could check if the current value is the same as
> the _INIT value, and override only in that case.
> 
> Or, (untested)
> IF( NOT MY_PROJ_RESET_DEFAULTS )
>   SET( CMAKE_C_FLAGS "..." CACHE STRING "Project default" FORCE )
>   SET( MY_PROJ_RESET_DEFAULTS 1 CACHE INTERNAL "Defaults written" FORCE )
> ENDIF( NOT MY_PROJ_RESET_DEFAULTS )

Great! Your second solution does the trick.

Cheers,

Albert