[CMake] Get Visual Studio target Arch

David Cole dlrdave at aol.com
Tue Sep 16 06:36:43 EDT 2014


> I still cant really make some arch specific ifdefs in my cmake
> scripts using this approach.


That's the point of a multi-configuration, multi-architecture Visual
Studio solution: you defer choosing the configuration *and* the
architecture until build time.

No "CMake time" decisions are possible based on the configuration or
the architecture with this approach because neither is known until
compile time.

It is inappropriate to "choose the configuration or architecture" in
CMake code with this approach, and you should re-think about it and see
if you can make compile time decisions instead, possibly with #ifdef
sections in your C/C++ code...

Rather than re-organize your libraries, you could easily just use
"win32/libs/$(Platform)" as your value when using the VS generators,
and this should work.


By the way, Gilles, I echo the sentiment: nice work! I wish MS had
gotten involved in CMake even earlier... but welcome!


HTH,
David C.




More information about the CMake mailing list