0

I understand that CMAKE_BUILD_TYPE only works for single-configuration generators like Unix Makefiles. There are also multi-configuration generators like Visual Studio or Xcode where CMAKE_BUILD_TYPE does not works. (see this and this question for further info). I've generated Visual Studio 2013 x86 project with cmake-gui for libharu and there is not possible to switch from win32 to x64 in Visual Studio. I'm wondering why in multi-configurations it is need to specify architecture (x86 or x64) in cmake? Why it is not possible in Visual Studio directly? Is there some limitation or benefit or something that I should be aware of?

Thanks

Community
  • 1
  • 1
Wakan Tanka
  • 7,542
  • 16
  • 69
  • 122
  • 1
    It's a cmake limitation and also kind of intentional. See here: http://stackoverflow.com/questions/5334095/cmake-multiarchitecture-compilation it is mentioned that cmake wants different build directories per compiler and 32 and 64-bit compilations are seen as with different compilers/compiler environment. Also cmake encourages out-of-source builds so you cannot unify 64 and 32 in a VS with that philisophy. – Hayt Sep 09 '16 at 09:18
  • @Hayt thanks for reply, please post it as an answer an I will accept it. – Wakan Tanka Sep 11 '16 at 11:01

1 Answers1

0

Because this switch between 32 and 64 bit is not available in all environments cmake follows the philosophy to use out-of-source builds and have each compiler in their own directory. So a 32 bit and a 64 bit build can be seen as a a different compilation environment so they each generate their own folders.

So while this is a cmake limitation it is also intentional.

This answer also mentions this: https://stackoverflow.com/a/5359191/152359

Community
  • 1
  • 1
Hayt
  • 5,210
  • 30
  • 37