[CMake] Cmake and Visual Studio platforms

Meteorhead nagymatef at freemail.hu
Fri Mar 1 05:28:38 EST 2013


I understand why CMake cannot resolve the issue in a single call to
configure. However...

how tricky/hard/impossible would it be to alter/rape the generate stage of
CMake to handle this issue? 

Let's say I wanted to create a Win32 and an x64 platform inside a
solution/project. Then I would start a VS command prompt for the native 64
and 32 bit compilers. I'd start a CMake GUI from both (or use the command
line, whatever) and configure once a 32-bit and once a 64-bit solution. The
tricky part comes here: both CMake instances have their output directory set
to the same directory.

I could image the generate stage (or even later internally just when writing
the output files), that when I generate let's say the 32-bit first, it sees
an empty directory, creates all neccessary files, and it's done. When I hit
generate the second time on the 64-bit configuration, it finds solution
files with Win32 set as platform. Instead of overwriting all the project and
solution files, it could insert into the xml code it's own x64 platform and
leave the others as it is. This way both platforms would compile and link
the proper libraries and dependencies.

Having met CMake as not an end-user only 3 weeks ago, I have little
knowledge of the intimacies of the configuration cache for example, so I
could imagine that having two different configuration set onto the same
output directory could cause mishaps, but that is why I ask the black-belt
people here.

I have not used other IDEs throroughly, but I can image CodeBlocks or XCode
has got their own equivalent (or maybe not) of platforms beside regular
build targets. Could this setup of configurate/generate serve as a solution
to our problem? Is there hope of it being implemented? Or are there
conceptual errors along the way that I have not come to realise?

(I could image changing the behavior of "shoot first, ask later", namely do
not check anything, just overwrite whatever we find in the target dir, could
be misleading in the sense that one would expect such behavior from all
generators, but instead the VS generator parses the found solution/project
files, and inserts code into it if the platforms differ, rather than
overwriting the entire thing. I believe these behavioral differences could
be overlooked, if one could make multi-platform solution files.)

Ideas? Suggestions? Flame?



--
View this message in context: http://cmake.3232098.n2.nabble.com/Cmake-and-Visual-Studio-platforms-tp7583415p7583436.html
Sent from the CMake mailing list archive at Nabble.com.


More information about the CMake mailing list