[CMake] Changing the the current generator in CMake GUI

Bill Hoffman bill.hoffman at kitware.com
Fri Jan 15 14:32:16 EST 2016


On 1/15/2016 11:26 AM, mozzis wrote:
>> You can not change the generator.  It is better to remove the entire
>> build tree.  Out of source builds are a best practice with CMake.  Once
>> a build tree has been configured with one compiler, it must be
>> completely removed to change to a new compiler
>
> Clearly, "can not" is incorrect, since I did. "must be" seems also
> incorrect.

You can do it by changing the CMakeCache.txt file, but it won't work in 
the general case.  You should put them in separate directories: build-32 
and build-64.
> It seems like the developers don't understand about 32-bit vs. 64-bit
> builds, or don't intend for this tool to be used with software that is a
> product. Determining that after painstakingly configuring all of the build
> options, the user must throw it all away in order to build for the other
> "bitness", seems wrong. Almost anyone that is intending to build software
> that can be installed (without the end user having to build it from source
> every time, that way lies madness) needs to produce a 32-bit and a 64-bit
> package these days.

You can build both 32 and 64 from the same SOURCE tree, just not the 
same build tree.

src
build32   (cmake ../src -G"Visual Studio 10 2010")
build64   (cmake ../src -G"Visual Studio 10 2010 Win64")

You seem to be trying to reuse the same build tree for different builds 
which is not a supported use case.  I think if you stopped doing that 
your life might get easier when working with CMake projects.


-Bill



More information about the CMake mailing list