[CMake] wxCmakeSetup

Bill Hoffman bill.hoffman at kitware.com
Fri Oct 26 13:42:03 EDT 2007


Mike Jackson wrote:
> I am more intersted in a nice Qt CMakeSetup but with some more added 
> features. wxWidgets and Fltk just do not look that good under OS X. I am 
> also hoping that if a nice Qt GUI were made Kitware might include it 
> since ParaView uses Qt. It would make a nice standardization on Qt, 
> which is a nice toolkit.
> 
> I would write the Qt if I new what to actually implement. Not being able 
> to compile the wx version leaves me with no real working code to look 
> at.  I guess a little hand holding or "this is where to look" or "you 
> need to implement these functions" would be a nice start.. hint hint..
> 

Sounds like 2.6.2 wxwidgets should work.


There are code examples for cmake gui's in the cmake source tree. 
ccmake, CMakeSetup, and wxCMakeSetup.   The MFC one is not a bad place 
to start.   Most of the work is done in a cmake object.   The basic gui 
does this:

1. load registry stuff from previous runs

2. configure
    - ask for a generator to use if one is not yet set
    - ask to create build directory if not there
    - save the gui values to the cache file
    - call cmake::Configure()
    - save stuff to registry

3. Generate
     - only allowed to do this if configure has been run and there are 
no new cache values or errors.
     - call cmake::Generate()
     - save stuff to the registry

The big part of the implementation is the save/load of the cache.  You 
don't actually have to save the cache, you just have to set values in 
the cache and call save on it.  You can find that code here:

// copy from the cache manager to the cache edit list box
void CMakeSetupDialog::FillCacheGUIFromCacheManager()
// copy from the list box to the cache manager
void CMakeSetupDialog::FillCacheManagerFromCacheGUI()

CMakeSetupDialog::FillCacheGUIFromCacheManager


-Bill



More information about the CMake mailing list