[Cmake] Force re-run of CMake from within CMake?

Andy Cedilnik andy . cedilnik at kitware . com
31 Oct 2003 15:14:37 -0500


Hi Amitha,

Sorry, FORCE_GLOBAL_GENERATE is your flag that you set when you want
cmake to regenerate. Then you write a file, which forces cmake to
regenerate. 

			Andy

On Fri, 2003-10-31 at 14:48, Amitha Perera wrote:
> On Fri 31 Oct 2003, Andy Cedilnik wrote:
> > Global generate always ignores results of try compile. So All you have
> > to do is to somehow force global generate. One of the tricks is this:
> > 
> > IF(FORCE_GLOBAL_GENERATE)
> >   FILE(WRITE "${CMAKE_CURRENT_BINARY_DIR}/some_file" "whatever")
> >   SET(FORCE_GLOBAL_GENERATE OFF BOOL "" FORCE)
> > ENDIF(FORCE_GLOBAL_GENERATE)
> > IF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/some_file)
> > CONFIGURE_FILE(${CMAKE_CURRENT_BINARY_DIR}/some_file
> >   ${CMAKE_CURRENT_BINARY_DIR}/some_file.done)
> > ENDIF(EXISTS ${CMAKE_CURRENT_BINARY_DIR}/some_file)
> 
> I apologise: this is still not clear to me. Is FORCE_GLOBAL_GENERATE a
> special internal variable? When is it set? What role does the
> CONFIGURE_FILE play in this? Why will this cause CMake to re-run?