[CMake] Changing the the current generator in CMake GUI

Greg Marr greg.marr at autodesk.com
Fri Jan 15 16:18:08 EST 2016


Bill Hoffman wrote:
>On 1/15/2016 2:41 PM, Greg Marr wrote:
>> You can do both in the same solution/projects with the Microsoft fork
>> of CMake, but it's not a general solution, and it doesn't handle
>> different settings for 32 bit and 64 bit. 
>
>Yes, and things like CMAKE_SIZEOF_VOID_P would not have valid values. 

Correct, so if you require different settings based on that value, you can't use this solution.  However, if you never look at it, then this may work for you.

> However, if you want cmake builds to work, you should never change the 
> generator in a CMakeCache.txt file, it is going to more often than not 
> cause problems.  A build tree should be configured with one generator 
> and if you need another generator you should use a different directory 
> and a different build tree sharing the same source tree.

Absolutely, that's why this is a single generator and is generated once.  

Unfortunately, the different settings limitation of this solution is rather...limiting.  It would be really nice if this could be made to work with different settings for the different CPU architectures (mostly just library paths for my past uses), just like native Visual Studio, XCode, Eclipse, and Android Studio projects do, but that would apparently be a very major change.



More information about the CMake mailing list