Hi David! We either misunderstand each other, or my knowledge of CMake is too limited, but let me try to clarify this one last time, and if you still say it cannot work, I'll leave it at that:
1) I configure my project using Win32 with output dir A. In this directory every intermediate test and result is cached that were needed to configure my project. 2) I press generate, and the actual project and solution files are assembled in a temp directory (or in memory). 2.5) NEW Prior to writing data on disk, CMake checks whether there are project/solution files with the name that it wishes to create. Sees that the target dir A is empty, and ultimately they are written to disk. 3) After this I close my previous session of CMake, open a new one with the x64 compiler toolset and try to configure my project using the Win64 generator to the same dir A. CMake sees that all cached variables are saved with a different compiler, and as you say, they become invalidated. So far, so good, I do not care about cached variables being invalidated, because my generated Win32 project file is already complete and written to disk. 4) I press generate, again in a temp dir (or in memory) my x64 project and solution files are assembled, and are ready to be written to disk. 4.5) NEW CMake checks whether there are project/solution files with the name that it wishes to create. It sees that there are files already inside dir A, opens them, checks the platform and if it is the same it is actually trying to write, it will overwrite normally. If the platform found on the disk is different than the one it tries to write, it makes the aforementioned insertions into the xml code and tadaaaa: I got my multi-platform VS solution. As far as I see no great refactoring is needed to be done in CMake. The only part where this could fail, is that using a new generator (and compiler) in the same dir A that already contains generated project files is wiped right at the beginning of the process. Since cached variables outlive a certain configuration/generation process, I suspect that the generated Make/IDE files do too, and they are only overwritten in this final step. (Tested: true) I have not seen CMake source code ever in my life, but I know that the previous Make/IDE files remain the same until the very last step of "Generate" when they are overwritten. This very last part would need to be altered in the sole case of VS project generators. If CMake developers say that the code is simply not structured like that, or it is too much work to rewrite these parts (and a few others that might depend on it), then I leave this subject be and not bother again with it. -- View this message in context: http://cmake.3232098.n2.nabble.com/Cmake-and-Visual-Studio-platforms-tp7583415p7583442.html Sent from the CMake mailing list archive at Nabble.com. -- Powered by www.kitware.com Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Follow this link to subscribe/unsubscribe: http://www.cmake.org/mailman/listinfo/cmake